Forum Moderators: phranque

Message Too Old, No Replies

Redirect from Folder to Main Page

Redirecting from Folder to Main Page

         

deezin

3:47 pm on Jan 10, 2006 (gmt 0)

10+ Year Member



Hello. I hope someone can help. I want to redirect from a folder on site one to the main page on site2. So for example...allfiles in

Site1/subdirectory/

should point towards

Site2/

so Site1/subdirectory/file1.html would be the same as Site2/file1.html etc...

I know that you put this in your .htaccess file when you are doing old-domain to new-domain redirection:

RewriteEngine On
RewriteBase /

RewriteRule ^(.*)$ [site2...] [R=301,L]

but how do you do a old-domain-folder to new-domain redirection?

Thanks!

MichaelBluejay

2:00 am on Jan 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



RewriteRule ^subdirectory/(.*)$ [site2...]

deezin

2:33 am on Jan 11, 2006 (gmt 0)

10+ Year Member



Thank you! I tried it myself before you posted your response to my questions and I got it to work.

RedirectPermanent /subdirectoryofoldsite/ [newsite.com...]

Even though it works, do both my way and your way work the proper way for Google SEO?

Thank you!

MichaelBluejay

2:52 am on Jan 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've never seen the RedirectPermanent syntax, but if it does work then Google can't tell the difference. I forgot to add [R=301,L] to the end of mine, but other than that it shouldn't matter which code you use.

deezin

3:03 am on Jan 11, 2006 (gmt 0)

10+ Year Member



I've never heard of it before either but I found it on an online article and it worked...I'd link to it here but we aren't allowed to post links. Thanks for your input! :-)

tedster

3:15 am on Jan 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a reference:

[httpd.apache.org...]