Forum Moderators: phranque

Message Too Old, No Replies

.htacess and 301 Redirect Issues

         

alexasigno

8:20 am on Oct 18, 2005 (gmt 0)

10+ Year Member



Well i am completely puzzled here and its driving me mad.
I used to have two separate domains with two separate hosting accounts, they were both set up so that the non www version of the site had a permanent 301 redirect to the www version. Solving the google canonical url issue.

Ie. http://example.com redirected to http://www.example.com

Using the simple Redirect 301 /index.html http://www.example.com/ would make sure that only the www.example.com was accessible.

However i now migrated both domains to the same hosting package, and now have a parked domain for another.com on my example.com domain.

I have another.com as a subdomain of example.com eg. [another.example.com...] which the domain another.com points to.

But i still need to have permanent 301 redirects for the non www versions for both domains.

BUT i still have one major problem for me, and that is i cannot redirect http://www.example.com/index.html to http://www.example.com/cms/

As in the .htaccess file if i set up a redirect rule for eg.

Redirect 301 /index.html http://www.example.com/cms/

It will also redirect [another.example.com...] to http://www.example.com/cms/

I have also tried using

RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/cms/$1 [R=301,L]

But this still redirects my another.com to the example.com/cms folder?

How do i specify exactly http://www.example.com/index.html to redirect without effecting the subdomain?

I hope someone can make sense of my giberish?

Cheers in advance Alex

g1smd

1:46 pm on Oct 28, 2005 (gmt 0)

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



Please make a list here, of all the redirects that you need, in exactly this format, to make it very clear what you are asking:

domain.com ---> www.domain.com

etc.