You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by rd...@starband.net on 2002/04/15 09:16:01 UTC
Problem with Rewrite Rules
I am having a problem with Rewrite Rule.
I what the user to be able to type in there domain name and then
admin and be redirected to a control panel on the same server but
running on a different port.
Like so
http://userdomainname/siteadmin
What I have below works but it changes the http://userdomainname to www.domain.com
I what it to stay the same as what they type in and not change to
the main site on the server. should I use a variable in the lines
below to do this and if yes how
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^:]+)
RewriteRule ^/admin/?$ http://www.domain.com:81/admincontrol/index.php
RewriteRule ^/siteadmin/?$ http://www.domain.com:81/usercontrol/index.php
In the VirtualHost settings
I have this
<VirtualHost 000.00.000.000>
DocumentRoot /usr/sites/www.domain.com/web
ServerName domain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} !^000.00.000.000(:80)?$
RewriteCond %{HTTP_HOST} !^www.domain.com(:80)?$
RewriteRule ^/(.*) http://www.domain.com/$1
RewriteOptions inherit
</VirtualHost>
Best regards,
Richard mailto:rdkurth@starband.net
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org