I've always used a HTML meta tag in the header. Works for me...
HTML tips: Redirect to a new page
Right, ok, I have googled and tried different things but here's the story...
I've just redone our school website (done an inbetween solution as they want to bring Moodle on stream properly sometime soon so it's more a static site than anything else) ..
Anyway, the old site was stored in /2 and I've moved the new site to the root so what I want to do is redirect all the:
Accrington St Mary Magdalen's CE Primary School
Now, using the standard:
Is great, only that is maps the old page name (for instance St Mary Magdalen's Primary School) to the new location (http://www.accringtonstmarymagdalens.co.uk/main.shtml) when that page doesn't exist in the new location.Code:Redirect 301 /2 http://www.accringtonstmarymagdalens.co.uk/
I think I'm writing in looking to do some sort of rewrite, but I'm out of practice with .htaccess files and the things I'm trying don't seem to be working, so, any suggestions?
Plus, HTML Meta Tags are great if you have no other option, but .htaccess redirects are more secure and better for page rankings on search engines and all that jazz ..
Something like this should work if you're using mod_rewrite.
Code:RewriteBase /2/ RewriteRule ^(.*)$ http://www.accringtonstmarymagdalens.co.uk/ [R=permanent,L]
Sussed it (thanks to Beyond Redirect: Using ReWriteRule in .htaccess) ..
Now to get the thing to redirect a non www. site to a www. site without getting the result of http://www.accringtonstmarymagdalens...agdalens.co.uk .. lol ..Code:Options +FollowSymlinks RewriteEngine on RewriteOptions MaxRedirects=10 RewriteRule ^2/(.+)$ http://www.accringtonstmarymagdalens.co.uk [R=301,NC]
There are currently 1 users browsing this thread. (0 members and 1 guests)