homepage Welcome to WebmasterWorld Guest from 54.242.231.109
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Conditional .htaccess?
Karma




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

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




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

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




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

Which has happened.

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

phranque




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved