simple rewrite .html to wordpress pretty permalink
3 posts
• Page 1 of 1
- seventelematics
-
- Posts: 2
- Joined: 28 Aug 2013, 05:38
simple rewrite .html to wordpress pretty permalink
Hi
I apologize if this has been answered somewhere else, but I have spent a long time searching.
We have purchased ISAPI Rewrite 3 and successfully used it to remove index.php from our wordpress permalinks with the following .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Now we need to implement a number of 301 redirects as the wordpress site has replaced a site made up of .html & .php pages.
For example
http://www.seventelematics.co.uk/index.html needs to redirect to http://www.seventelematics.co.uk
http://www.seventelematics.co.uk/transcan-2-ext.php needs to redirect to http://www.seventelematics.co.uk/produc ... 2-trailer/
If someone could reply with the code to add to our .htaccess file for the above examples, it would be much appreciated.
Thanks
Jonathan
I apologize if this has been answered somewhere else, but I have spent a long time searching.
We have purchased ISAPI Rewrite 3 and successfully used it to remove index.php from our wordpress permalinks with the following .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Now we need to implement a number of 301 redirects as the wordpress site has replaced a site made up of .html & .php pages.
For example
http://www.seventelematics.co.uk/index.html needs to redirect to http://www.seventelematics.co.uk
http://www.seventelematics.co.uk/transcan-2-ext.php needs to redirect to http://www.seventelematics.co.uk/produc ... 2-trailer/
If someone could reply with the code to add to our .htaccess file for the above examples, it would be much appreciated.
Thanks
Jonathan
Re: simple rewrite .html to wordpress pretty permalink
Hello, Jonathan
Here are the redirect rules for you:
RewriteRule ^index\.html$ / [NC,R=301,L]
RewriteRule ^transcan-2-ext\.php$ /products/temperature-data-loggers/transcan-2-trailer/ [NC,R=301,L]
How many rules are you going to have? If there are quite a lot of them (150 and more), you may consider using mapfiles to make them work faster.
(see example here http://www.helicontech.com/articles/url ... plication/)
Here are the redirect rules for you:
RewriteRule ^index\.html$ / [NC,R=301,L]
RewriteRule ^transcan-2-ext\.php$ /products/temperature-data-loggers/transcan-2-trailer/ [NC,R=301,L]
How many rules are you going to have? If there are quite a lot of them (150 and more), you may consider using mapfiles to make them work faster.
(see example here http://www.helicontech.com/articles/url ... plication/)
- seventelematics
-
- Posts: 2
- Joined: 28 Aug 2013, 05:38
Re: simple rewrite .html to wordpress pretty permalink
Thanks Anton, this worked perfectly and allowed me to workout the others. I will probably have around 20 when finished so won't need to use mapfiles.
Jonathan
Jonathan
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 25 guests