iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Search Engine Optimization Forum SEO is much easier with help from peers and experts! The WebProWorld SEO forum is for the discussion and exploration of various search engine optimization topics. Any non (engine) specific SEO or SEM topics should go here.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-09-2005, 10:47 AM
WebProWorld Pro
 
Join Date: Apr 2004
Posts: 163
roam_dx RepRank 0
Default more redirect help plz!!!

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
Reply With Quote
  #2 (permalink)  
Old 07-09-2005, 05:44 PM
WebProWorld MVP
WebProWorld MVP
 
Join Date: Jul 2004
Location: Omaha
Posts: 2,714
brian.mark RepRank 3brian.mark RepRank 3
Default Re: more redirect help plz!!!

Quote:
Originally Posted by roam_dx
^/website-reviews/mypage.html$ http://www.mysite.com/web-site-services/mypage.html RedirectMatch permanent
This is redirecting one folder to another as a 301.

Quote:
Originally Posted by roam_dx
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursitename.com$
RewriteRule ^(.*)$ http://www.yoursitename.com/$1 [R=301,L]
This is redirecting from yoursitename.com to www.yoursitename.com as a permanent (301).


Quote:
Originally Posted by roam_dx
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]
Your second rule here is not correct. Keep the original way of doing the 301's for pages / directories and just put the Rewrite conditions and rules at the end of the file.


Quote:
Originally Posted by roam_dx
RewriteEngine On
Redirect 301 /website-reviews/mypage.html http://www.yourdomain.com/blog/zonk.html
This looks just fine. You could use this if you like, although it isn't using the RewriteEngine at all.


Quote:
Originally Posted by roam_dx
RewriteRule ^olddir/(.*)$ http://new.com/newdir/$1 [R=301,L]
This is correct if you'd prefer to use a rule instead of just a Redirect.

Quote:
Originally Posted by roam_dx
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
That last one would redirect the entire folder, all pages inside it included in that redirect. The problem with cpanel is that it isn't doing a rewrite rule, so it can't do conditional redirects. Basically, it's redirecting anything to www.yoursitename.com/anything and it gets stuck in an infinite loop. You've found all the correct code already, so just give it a try. The worst that can happen is you have to put your original file back on the server (make sure you back that up before making too many changes.)

Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies
Reply With Quote
  #3 (permalink)  
Old 07-10-2005, 08:14 AM
WebProWorld Pro
 
Join Date: Apr 2004
Posts: 163
roam_dx RepRank 0
Default

thanks Brian,

I added this code at the bottom of my current file (with the original cpanel code) & the

http:// redirect is working fine, and so are most the individual page redirects


RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursitename.com$
RewriteRule ^(.*)$ http://www.yoursitename.com/$1 [R=301,L]


Since of the pages that I have moved are about the only pages on my website currently getting any traffic from search engines, I just want to confirm, that the original code is ok

SE wise, i mean it's a proper 301 redirect, since the code doesn't mention "301" anywhere,

that's -


^/website-reviews/mypage.html$ http://www.mysite.com/web-site-services/mypage.html RedirectMatch permanent


you may have already commented on this, just want reconfirm, since i have seen a lot said about choosing the right method to redirect you pages.

that was good advice about the back up, usually do it, but then just at the last moment, it often silps from memory.

thanks again, appreciate the help.
Reply With Quote
  #4 (permalink)  
Old 07-10-2005, 07:31 PM
WebProWorld MVP
WebProWorld MVP
 
Join Date: Jul 2004
Location: Omaha
Posts: 2,714
brian.mark RepRank 3brian.mark RepRank 3
Default If you want to make sure...

If you want to make sure, use this tool to see what the redirect really is. Since it says permanent, that is a 301, but it's usually a good idea to test it anyway.

Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies
Reply With Quote
  #5 (permalink)  
Old 07-11-2005, 01:20 AM
WebProWorld Pro
 
Join Date: Apr 2004
Posts: 163
roam_dx RepRank 0
Default

hey brian, great tool. tells me its a permanent 301, so i'll just stick with cpanel redirects, easy to manage.

thanks for your help
Reply With Quote
Reply

  WebProWorld > Search Engines > Search Engine Optimization Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:54 PM.



Search Engine Optimization by vBSEO 3.3.0