Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Mar 16, 2011 10:49 am 
Offline
Senior Newbie

Joined: Wed Mar 16, 2011 10:08 am
Posts: 11
Hi,

Apache seems to add an extra slash to URL. I googled the subject, but didn't find a solution that works in all cases:

example.com//
example.com//path1/path2//

How do I remove extra slashes or I should not bother about it at all?


Top
   
 Post subject:
PostPosted: Wed Mar 16, 2011 11:14 am 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
Apache isn't doing that by default. It's something you've changed for example.


Top
   
 Post subject:
PostPosted: Thu Mar 17, 2011 8:43 am 
Offline
Senior Newbie

Joined: Wed Mar 16, 2011 10:08 am
Posts: 11
waldo wrote:
Apache isn't doing that by default. It's something you've changed for example.


An extra slash was added as a consequence of my RewriteRule:
Code:
<VirtualHost example.com:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot "/var/www/sites/example.com/current/public"
    ErrorLog "/var/log/apache2/example.com-error_log"
    CustomLog "/var/log/apache2/example.com-access_log" common
    <Directory "/var/www/sites/example.com/current/public">
        Options All
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    RewriteEngine On
    # Remove the www
    RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
    RewriteRule ^/(.*)$ http://example.com/$1 [L,R=301]
</VirtualHost>


I added a slash to the ^/(.*)$ expression and it solved the problem.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
RSS

Powered by phpBB® Forum Software © phpBB Group