2012-08-17, 18:01:13
Just wondering if any of you chaps could help out with a htaccess problem I'm having? I'm not too hot on htaccess rules so any help would be appreciated.
I'm moving a customer from a static html site over to Get Simple and I want to make sure that the changeover doesn't affect his seo rankings which are pretty darn good.
At the moment a link to a page on his site looks like this:
Get Simple now displays links like this (which is exactly what I want):
I have the default htaccess file which is as follows:
What would I need to add/change so that anyone who clicks on an old link from a search engine (which has .html at the end of it) will be taken to the dynamic non-.html version without throwing up an error 404 page?
I don't want to change all the pages on the site to include the .html suffix via htaccess and the custom slug option, just redirect any requests for a page ending with .html to the non-.html page.
Hope that makes sense - any help would be appreciated as htaccess always blows my mind!
I'm moving a customer from a static html site over to Get Simple and I want to make sure that the changeover doesn't affect his seo rankings which are pretty darn good.
At the moment a link to a page on his site looks like this:
Code:
www.his-site.com/a-page-title-here.html
Get Simple now displays links like this (which is exactly what I want):
Code:
www.his-site.com/a-page-title-here
I have the default htaccess file which is as follows:
Code:
AddDefaultCharset UTF-8
Options -Indexes
# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
Order allow,deny
Deny from all
Satisfy All
</Files>
<Files sitemap.xml>
Order allow,deny
Allow from all
Satisfy All
</Files>
RewriteEngine on
# Usually it RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
What would I need to add/change so that anyone who clicks on an old link from a search engine (which has .html at the end of it) will be taken to the dynamic non-.html version without throwing up an error 404 page?
I don't want to change all the pages on the site to include the .html suffix via htaccess and the custom slug option, just redirect any requests for a page ending with .html to the non-.html page.
Hope that makes sense - any help would be appreciated as htaccess always blows my mind!