Currently I'm building application on my local computer. Application is located in
/www/projects/mycustomproject/
and for speed of access it has its own personal domain, lets say mycustomproject.com
. I have made my Apache-PHP-MySQL available via local network, so anyone can access my project by IP address which is 192.168.1.80
and it's linked to /www/
.
To access application you have to type 192.168.1.80/projects/mycustomproject/
, and here come the problem, by default config for mycustomproject.com
is:
RewriteEngine on
RewriteBase /
To access application by IP address it suppose to be:
RewriteEngine on
RewriteBase /projects/mycustomproject/
The question is how can I define rule something like this:
if REMOTE_ADDR == 192.168.*
RewriteBase /projects/mycustomproject/
else if HOSTNAME == 'mycustomproject.com'
RewriteBase /
etc.
Possibly there could be other custom conditions based on hostname or IP address and IF/ELSE
statements are more preferable over RewriteCond