Welcome to WebmasterWorld Guest from 54.146.240.181

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Conditional .htaccess?

     

Karma

3:15 pm on Aug 16, 2011 (gmt 0)

10+ Year Member



Just wondering if there is a way to switch between htaccess rules depending on the url? In this scenario, I want to switch between rules depending if I'm on my localhost or live server?

For ages now I've just been renaming the .htaccess files - but is there an easier way?

g1smd

6:55 pm on Aug 16, 2011 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Set the configuration in the localhost site to use a different filename, one other than .htaccess and you can then be sure to never accidentally overwrite a file with the wrong version.

Karma

7:36 pm on Aug 16, 2011 (gmt 0)

10+ Year Member



Which has happened.

Could you please be a little more specific, I'm not sure what you mean by 'configuration' - httpd.conf?

phranque

8:52 am on Aug 17, 2011 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



you can configure the name of the distributed configuration file per virtual host in httpd.conf using the AccessFileName Directive:
http://httpd.apache.org/docs/current/mod/core.html#accessfilename
 

Featured Threads

Hot Threads This Week

Hot Threads This Month