I moved from static pages to a CMS (Textpattern), so I set up a mod_rewrite rule to redirect my dynamic links to the new ones. It's working, sort of. All links redirect, but not to the appropriate subpages. Instead, they all land at the homepage. The original link structure was in the format of http://www.ajw-art.com/index.php?page=illustration Here's what I have in my .htaccess file. This is the first time I've tried to do this, so any help would be appreciated: #DirectoryIndex index.php index.html #Options +FollowSymLinks #Options -Indexes <IfModule mod_rewrite.c> RewriteEngine On #RewriteBase /relative/web/path/ RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) - [PT,L] RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*) index.php RewriteCond %{HTTP:Authorization} !^$ RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}] RewriteCond %{QUERY_STRING} ^page=illustration$ RewriteRule ^/index.php$ http://www.ajw-art.com/portfolio/? [R=301,L] RewriteCond %{QUERY_STRING} ^page=resume$ RewriteRule ^/index.php$ http://www.ajw-art.com/resume/? [R=301,L] RewriteCond %{QUERY_STRING} ^page=contact$ RewriteRule ^/index.php$ http://www.ajw-art.com/contact/? [R=301,L] </IfModule> #php_value register_globals 0
You can do simplier on wordpress by adding some text bellow on 404.php from edit html.. <?php header("Status: 301 Moved Permanently"); header("Location:http://www.yoursite.com/"); ?> don't forget to change the yoursite.com text..
@aandamar But since all pages use the same 404, wouldn't that still direct traffic back to the homepage? From what I gathered while researching the issue, I thought I had to use an .htaccess solution because I was dealing with individual dynamic pages that I want remapped to the appropriate subpages.
method that I posted is for the noobs, they can easily redirect the loss page to homepage without opened the cpanel.. editing .htaccess still better than anything that I do.. regards