Removing the double slash from behind the domain name

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Webmasterks
Registered User
Posts: 274
Joined: Tue May 27, 2003 11:28 pm
Location: The Hague, The Netherlands
Contact:

Removing the double slash from behind the domain name

Post by Webmasterks »

Hi all,

A couple days ago I updated my forum from 3.0.10 > 3.2 and I also had my webhost install a SLL-certificate for my domain. After browsing this support forum I found a redirect that I had to put in my .htaccess, so that there would be a redirect from http > https. That all seemed to go well, but after that I noticed on my forum that the URL's looked weird. There was an extra slash behind my domainname. So it looked like:

Code: Select all

https://www.domain.com//phpBB3/
instead of

Code: Select all

https://www.domain.com/phpBB3/
I found out that the redirect, which is this:

Code: Select all

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://www.domain.com/%{REQUEST_URI} [R,L]
has a slash behind the domain name. I removed the slash from the redirect and now the URLs are back to normal. Apparently, the REQUEST_URI takes care of the slash?

So, for it to show only one slash in the URL, the redirect should look like this:

Code: Select all

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://www.domain.com%{REQUEST_URI} [R,L]
Also, since my forum is located at

Code: Select all

https://www.domain.com/phpBB3
I also uncommented and changed the RewriteBase line in the .htaccess into:

Code: Select all

RewriteBase /phpBB3/
Now, as it all seems to work fine now, my question is: is this all the best solution?
Post Reply

Return to “[3.2.x] Support Forum”