Forum Moderators: phranque

Message Too Old, No Replies

Can I apply Mod Rewite just to a certain folder?

         

skuba

9:33 pm on Nov 18, 2004 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi,
I am doing a SEO work for a website and I need to run a mod_rewrite with .htaccess.
But I want to test everything before making it live. So I setup a working clone of the site under a folder named test. For example www.mysite.com/test/
Is there a way to apply the .htacess or the mod_rewrite just to that folder?
I don't want to be taking the site off, while I am doing tests with the .htaccess, that's why I wanted to do on a test site.
Is it possible? Is there a better way?
Thanks a lot for helping.

storevalley

10:17 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



As I remember it .htaccess works on the folder you put it in and all subfolders unless one of them contains its own .htaccess file.

So you should just be able to do a test in a subfolder of the site as suggested :)

skuba

10:31 pm on Nov 18, 2004 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks. I will try that.

jdMorgan

10:34 pm on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A) Put the .htaccess code in the subdirectory where you wish to test.
-or-
B) Include the subdirectory path in all patterns and substitutions in the .htaccess code.

Of the two, method A is easier and less intrusive to the site.

Jim

Jazeker

12:28 pm on Nov 19, 2004 (gmt 0)

10+ Year Member



if you don't use .htaccess files, using a <directoy> tag in your httpd.conf should also do.