Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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