apache mod_rewrite, trailing slash, serveralias

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. ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-02-2005
finest137@yahoo.com
 
Posts: n/a
Default apache mod_rewrite, trailing slash, serveralias

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:54 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0