Forum Moderators: phranque
I have two sites , we have a special configuration such that we have a 2 configuration files , one is common http.conf and server specific httpd.conf.
Each individual site uses common and server configuration and works fine.
www.test.xyz.com
www.kool.xyz.com
Whatever entry is made in common, its avaialable to all servers....
I am trying to use this centralized configuration for redirecting . Here is my logic . I am putting the below configuration file in common conf file .. so that when somebody says www.test.xyz.com , he should be redirected to www.test.xyz.com/test
and for www.kool.xyz.com , he should be redirected to www.kool.xyz.com/kool
RewriteEngine on
RewriteCond %{HTTP_HOST} www\.([^.]+)\.xyz\.com
RewriteRule ^/(.*)$ /%1/$1 [L]
For some reasons this is not working... let me know if i am missing something...
i had put the configuration under 443...Port 80 redirecting 443.
we have webserver running on ports 80 and 443..
thats
<VirtualHost *:80>
Redirect / [test.xyz.com...]
</VirtualHost>
RewriteEngine on
RewriteCond %{HTTP_HOST} www\.([^.]+)\.xyz\.com
RewriteRule ^/(.*)$ /%1/$1 [L]
For some reasons still above is not working... So
I tried with below, still not working
RewriteEngine on
RewriteCond %{HTTP_HOST} www\.([^.]+)\.xyz\.com
RewriteCond {SERVER_PORT} ^443$
RewriteRule ^/(.*)$ /%1/$1 [L]