skip to Main Content

All the files and subfolders that used to make up our old Flash website do not exist anymore and so the URL paths to all the pages are broken.

We could use help writing a Redirect for specific URL’s as well as catch all rewrite rule for subfolders to redirect to the base domain / URL.

ex.) Specific URLs

example.com/home.html
example.com/info.html

Any file path or image/asset or page url within these subfolders redirect to root domain

example.com/flash/devices.html
example.com/flash/images/diagram.png

example.com/external/m2000.zip

New site is built with the latest version of WordPress / Apache / PHP

EDIT

Current .htaccess code

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


RewriteEngine on
RewriteCond %{REQUEST_URI} ^(/home.html|/info.html|/flash|/external)
RewriteRule (.*) http://qcmresearch.com [R=301,L]
</IfModule>

# END WordPress

2

Answers


  1. You can use “https://wordpress.org/plugins/simple-301-redirects/” Simple 301 Redirects plugin for the same.

    Login or Signup to reply.
  2. The below .htaccess rewrite rule will work for you

    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^(/home.html|/info.html|/flash|/external)
    RewriteRule (.*) http://example.com [R=301,L]
    

    The online working code for the same is at .htaccess tester

    The above code will

    Redirect specific url’s like below to root domain

    example.com/home.html
    
    example.com/info.html
    

    Redirect particular subfolders like below to room domain

    example.com/flash/devices.html
    example.com/flash/images/diagram.png
    
    example.com/external/m2000.zip
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search