.htaccess URL Rewrite

.htaccess URL Rewrite

am 07.12.2007 16:35:05 von Chris Jones

On our corporate intranet (bbcreports.systems.uk.mycorp) i have
created a PHP application in the directory public_html/php/edd

I want to have a 'virtual' domain, e.g.
http://edd.bbcreports.systems.uk.mycorp
which in effect points to
http://bbcreports.systems.uk.mycorp/php/edd/

From reading the apache docs, i've gleaned this bit of rewrite code...

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.[^.]+\.host\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^www\.([^.]+)\.host\.com(.*) /home/$1$2


Last time i messed around with a .htaccess file i crashed the server
(i think!), so would appreciate some advice on the correct rewrite
rules... this is what i've got:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^\.[^.]+\.bbcreports
\.systems.uk.mycorp$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ([^.]+)\.bbcreports\.systems\.uk\.mycorp(.*) /home/$1/
php/$2

Thanks