Forum Moderators: phranque

Message Too Old, No Replies

301 Redirect

         

Dgriff

9:09 pm on Nov 22, 2010 (gmt 0)

10+ Year Member



Hi
I'm trying to use 301 redirect to tell the browser that my site sits in a sub folder. It works! The only problem is that when I also try to go to my admin area, I'm redirected to my online store. I have another site in another sub folder (for demonstration purposes only) When I try to go to that site I'm redirected to my online store again.
In my public_html folder I have the following:
1. catalog folder (within that is my demonstration site)
2. store folder (in this folder is another folder and my store sits in there...see below)
3. htaccess file.

This is the content of the .htaccess file:
DirectoryIndex /store/catalog/index.php


I want to use the 301 redirect but I dont want to be directed to my online store when I need access to the admin area and the demonstration site. Thanks.

jdMorgan

7:45 pm on Nov 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use a RewriteRule to do the redirect. Use RewriteConds on that rule to exclude URL-paths which should not be redirected, by specifying negative-match patterns for the RewriteConds.

Jim

Dgriff

10:23 pm on Nov 30, 2010 (gmt 0)

10+ Year Member



Thanks Jim.
I'm new to this. How might that rule look like? If I could get an example I could put in the appropriate URL paths to be excluded. Thanks.

jdMorgan

8:56 pm on Dec 6, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are lots of examples in our Apache Forum Library. Also see the URL Rewriting guide at Apache.org

Jim