0

i'm looking for a way to set RewriteBase in my .htaccess depending on if my web runs locally or live.

it should be something like:

if(localhost) RewriteBase /mylocalweb/
if(www.mydomain.com) RewriteBase /

any ideas how to do it? thanks

Stephan Muller
  • 27,018
  • 16
  • 85
  • 126
Fuxi
  • 329
  • 2
  • 6
  • 15
  • See http://stackoverflow.com/questions/7813554/how-would-i-write-an-if-elseif-elseif-conditional-block-in-an-htaccess-file for your answer – Xavjer May 29 '13 at 15:51

1 Answers1

0

Use RewriteCond in front of your RewriteRule instead of fiddling with RewriteBase

See: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritecond

noamik
  • 756
  • 6
  • 22