Pete Long
asked on
Wordpress - Redirects failing since upgrade to 4.4
Hi,
I migrated my site to wordpress a couple of months ago, and part of that process was to redirect all my old technical article URL's to the new URL
e.g (OLD SITE and Link)
http://www.petenetlive.com/KB/Article/0000213.htm
redirects to (NEW SITE and link)
http://www.petenetlive.com/KB/Article/0000213
Since the upgrade this has stopped working! (I paid a third party to migrate the website, I have no ides how they did it, how can I fix this!!)
The only thing that changes is the article number, I don't want to do a 301 for each one (theres over 1100 of them!!)
Help
Pete
I migrated my site to wordpress a couple of months ago, and part of that process was to redirect all my old technical article URL's to the new URL
e.g (OLD SITE and Link)
http://www.petenetlive.com/KB/Article/0000213.htm
redirects to (NEW SITE and link)
http://www.petenetlive.com/KB/Article/0000213
Since the upgrade this has stopped working! (I paid a third party to migrate the website, I have no ides how they did it, how can I fix this!!)
The only thing that changes is the article number, I don't want to do a 301 for each one (theres over 1100 of them!!)
Help
Pete
Try
# BEGIN WordPress
# Ensure the rewriet module is loaded
<IfModule mod_rewrite.c>
# enable the rewrite engine
RewriteEngine On
# Set the root directory
RewriteBase /
RewriteRule ^(.+?)\.html?$ /$1 [L,NC,R=301]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
ASKER
William, Spot on, that exactly what I needed, ThanQ
If I need to add a couple of 301 redirects where would I put them?
Regards,
Pete
If I need to add a couple of 301 redirects where would I put them?
Regards,
Pete
ASKER
spoke too soon? I upload it it worked brilliantly, now its stopped working?
Check that it hasn't changed. WordPress tends to rewrite .htaccess if you change or fiddle with the permalinks settings.
If that is the case, it may be better to place
If that is the case, it may be better to place
RewriteEngine On
RewriteRule ^(.+?)\.html?$ /$1 [L,NC,R=301]
right at the very top of the file, outside of the WordPress commented section.
ASKER
Hi it now looks like this
Is that OK? (it appears to be working :) Fingers Crossed!
Pete
# Ensure the rewrite module is loaded
<IfModule mod_rewrite.c>
# enable the rewrite engine
RewriteEngine On
# Set the root directory
RewriteBase /
RewriteRule ^(.+?)\.html?$ /$1 [L,NC,R=301]
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Is that OK? (it appears to be working :) Fingers Crossed!
Pete
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.htm -f
RewriteRule ^(.*)$ $1.htm
To the .htaccess file but them all the links fail!!!