epixmedia
Member
Posted 9 months ago #
Hi everyone, I've searched the forums and Google but with no luck yet. I am trying to set up a wordpress site with some 301 redirects via the .htaccess file.
The website is on a fasthost server and due to the 404 issue with fasthosts I am having to redirect all the old URLs.
This is the contents of my .htaccess file which I am uploading to the root of my site. Whenever you go to one of the old URLs though I just get the standard "Page Cannot Be Displayed".
# BEGIN WordPress
redirect 301 /antivirus.htm http://www.justthinkit.co.uk/index.php
redirect 301 /linkspage.htm http://www.justthinkit.co.uk/
redirect 301 /index.htm http://www.justthinkit.co.uk/
redirect 301 /contact.htm http://www.justthinkit.co.uk/
redirect 301 /servicesdiagnostic.htm http://www.justthinkit.co.uk/
redirect 301 /history.htm http://www.justthinkit.co.uk/
redirect 301 /services.htm http://www.justthinkit.co.uk/
redirect 301 /whyus.htm http://www.justthinkit.co.uk/
redirect 301 /praise.htm http://www.justthinkit.co.uk/
redirect 301 /support.htm http://www.justthinkit.co.uk/
# END WordPress
Thanks in advance.
assuming you are on a linux server, I'm thinking the server is not really interpreting those as internal links
try this and see if it works
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.yoursite.com/antivirus.htm
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
epixmedia
Member
Posted 9 months ago #
Hi, thanks for the help, I've tried your suggestion. I tested it with just 1 page so I had the below in my .htaccess but its still not working. Am still just getting Page cannot be displayed.
If anyone has any other suggestions I'd be grateful. It wouldn't surprise me if its just another problem with fast hosts!
# BEGIN WordPress
RewriteEngine On
RewriteCond %{HTTP_POST} ^www.justthinkit.co.uk/antivirus.htm
RewriteRule (.*) http://www.justthinkit.co.uk/$1 [R=301,L]
# END WordPress
are you sure you're not on a windows server?
epixmedia
Member
Posted 9 months ago #
I've just checked and it is a Windows Server! Does this mean I can't redirect via the .htaccess or do I just need to do it a different way?
Thanks for your time.
Zoe
I'm not a windows guy but my understanding is you have to redirect at server level
ask your host about this