Jump to content


SSL + htaccess redirect on missing trailing slash

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 liamegan



  • Members
  • PipPipPip
  • 41 posts

Posted 27 November 2010 - 09:57 PM

I have a small problem whereby, when browsing https, lemonstand redirects from:
https://www.mysite.com/about (or whatever)

The logical assumption is that this is happening due to some quirk or Apache configuration issue during the htaccess trailing slash redirection, but I can't work out how or why.

This site is currently hosted with mediatemple and I'm browsing the site using a hosts file setup. I had wondered if my hosts file setup might be the problem, but for the life of me I can't imagine why that would be the case.

Has anybody else had this problem?

My htaccess setup is as follows:
AddHandler php5-script .php


RewriteEngine on
RewriteOptions MaxRedirects=1

# You may need to uncomment the following line on some hosting environments, 
# for example on unitedhosting.co.uk
# RewriteBase /

# Do not allow executing any PHP scripts

RewriteRule ^(.*).php$ index.php [L]

# The following section automatically adds a trailing slash to all URLs

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteCond %{HTTP:X-REQUESTED-WITH} !^(XMLHttpRequest)$
RewriteCond %{REQUEST_METHOD} !^HEAD$ 
RewriteCond %{REQUEST_METHOD} !^POST$ 
RewriteRule (.*)([^/])$ %{REQUEST_URI}/ [R=301,L]

# Product files downloading URL

RewriteRule (^download_product_file/.*) index.php?q=/$1 [L,QSA]

# Administration Area file downloading URL

RewriteRule ls_backend/files/get/(.*) index.php?q=/backend_file_get/$1 [L]

# All other requests

RewriteCond %{REQUEST_URI} !(\.(ico|js|jpg|gif|css|png|swf|txt|xml|xls|ttf|woff|svg|eot)$)
RewriteCond %{REQUEST_URI} !(phproad/thirdpart/.*)
RewriteRule ^(.*)$ index.php?q=/$1 [L,QSA]

ErrorDocument 404 "File not found"

# PHP configuration

<IfModule mod_php5.c>
php_flag session.auto_start off
php_value session.cookie_lifetime 31536000
php_flag session.use_cookies on
php_flag session.use_only_cookies on
php_value session.name FWCSESSID

php_flag short_open_tag on
php_flag asp_tags on

php_flag magic_quotes_gpc off
php_value date.timezone GMT

php_value post_max_size 100M
php_value upload_max_filesize 100M

php_value memory_limit 264M

#2 Guest_Aleksey_*

  • Guests

Posted 28 November 2010 - 10:30 PM


Please try enabling the STANDARD_HTTP_PORTS configuration option. It is described in this documentation article: http://lemonstandapp...ration_options/ (the last option in the list).

Thank you