This is a discussion on apache mod_rewrite, trailing slash, serveralias within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hello, I've run into a problem with the subject. Sorry if this was answered - I could not find it. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I've run into a problem with the subject. Sorry if this was answered - I could not find it. I have both wap and www sites in the same VirtualHost entry, and a simple rewrite rule: <VirtualHost *> <Directory /var/www/vhosts/site> AllowOverride All Options FollowSymLinks Includes Order allow,deny Allow from all </Directory> DocumentRoot /var/www/vhosts/site ServerName site.com ServerAlias wap.site.com RewriteEngine on # wap site is in /wap/ directory RewriteCond %{HTTP_HOST} ^wap\.site\.com$ RewriteRule ^/(.*)$ /wap/$1 </VirtualHost> Everything works nicely, except one thing: when I access url like wap.site.com/dir (without slash), it gets redirected to site.com/dir/ instead of site.com/wap/dir I can fix this by splitting Virtual host into two, one for site.com and one for wap.site.com. But maybe there is a (simple) way to fix this? Thanks a lot Alex |