I've moved my blog and would like to inform search engines and spiders to find the new blog and pass the PR from the old pages to the new pages.
AIUI I need to create an .htaccess file in the domain root which I have done, it doesn't work (i.e. if I enter an old URL it displays the old page (which still exists) and does not redirect to new page).
The .htaccess file contains:
---
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^cantbarsed.com/blog/ [nc]
rewriterule ^(.*)$ http://blog.cantbarsed.com/$1 [r=301,nc]
---
Do I need to remove the old pages before it will work or is the code wrong?
Any help gratefully received.
Joe's CantBarsed Blog | Discount Codes
there are prettier ways of doing it, but this should work:
that needs to go in your root's .htaccess fileCode:RewriteEngine On Redirect 301 /blog http://blog.cantbarsed.com RedirectMatch 301 ^/blog/(.*)$ http://blog.cantbarsed.com/$1
affiliates4u Fantasy Football Winner 2007/08
Thanks for that Ian, much appreciated.
It needed a bit of further tweaking (my programmer mate took a look - he fell down the stairs over the weekend and is just out of hospital - I think he's still a bit "punchy" because I'm not convinced it's 100% sorted but it's doing something):
Code:RewriteEngine On Redirect 301 /blog http://blog.cantbarsed.com #RedirectMatch 301 ^/blog/(.htm)$ http://blog.cantbarsed.com/$1.html RewriteRule ^blog/(.+)\.htm$ http://blog.cantbarsed.com/$1.html [R=301,NC]
Joe's CantBarsed Blog | Discount Codes
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks