Jump to content

double slash to single slash


Keniki

Recommended Posts

Hi I am trying to achieve the following

 

What I want to do is redirect a directory from a double slash to a single slash.

 

For instance

 

www.yoursite.com//directory/

 

Redirected to

 

www.yoursite.com/directory/

 

Or

 

www.yoursite.com/directory//directory2/

 

Redirected to

 

www.yoursite.com/directory/directory2/

 

I keep sending apache into a loop when trying this. Any help gratefully recieved.

 

Link to comment
https://forums.phpfreaks.com/topic/41884-double-slash-to-single-slash/
Share on other sites

Hi thanks for your help but this in the end did not solve the problem. The following provided by my most excellent host proved to be the final answer (they don't normally do this)....

 

RewriteCond %{REQUEST_URI} //

RewriteRule ([^/]*)/+(.*) http://www.exampledomain.com/$1/$2 [R=301,L]

 

Host is Rackspace

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.