Hi All,
I have changed folder names for some of my website pages. I have twice before used a redirect option from my cpanel (I don't undertand much about servers and did not want to mess with the .htaccess till necessary), it works fine, the pages are redirected. I also get an option of choosing permanent or temporary redirect, here I choose the permanent option. All this worked until I tried doing a redirect from
http://site.com to
http://www.site.com. This doesn't work, when I try this the site goes down.
So..I downloaded my .htaccess file. Now this is the code they are using for the redirects.
^/website-reviews/mypage.html$
http://www.mysite.com/web-site-services/mypage.html RedirectMatch permanent
Just want to confirm, is this a proper 301?
It is different from the one i have found on this website and others, which is,
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursitename.com$
RewriteRule ^(.*)$ http://www.yoursitename.com/$1 [R=301,L]
Should I use the more common one (2nd one) instead or leave is as it is? In my .htaccess
i don't see a RewriteEngine On command anywhere
Also, if I have to switch the commands, will this same code work for the pages I want to redirect too, other than the domain redirect, like
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursitename.com$
RewriteRule ^(.*)$ http://www.yoursitename.com/$1 [R=301,L]
RewriteCond % ^/website-reviews/mypage.html$
RewriteRule ^(.*)$ http://www.mysite.com/web-site-services/mypage.html$1 [R=301,L]
It seemed logical to remove the {HTTP_HOST} for the page redirects, should I keep it?
I also found this somewhere on the forum, to rediect pages
RewriteEngine On
Redirect 301 /website-reviews/mypage.html
http://www.yourdomain.com/blog/zonk.html
and this to redirect directories
here
RewriteRule ^olddir/(.*)$ http://new.com/newdir/$1 [R=301,L]
just different syntax...all of them!! To me it all looks like gibberish....very confused, can someone please guide me on how I can handle this. don't want to crash my servers or freak the spiders out...they don't come around much anyway :)
Also since I renamed a folder...is it possible to just redirect the folder so that the contained pages are automatically redirected?
thank you