LemonStand Forum: mod_rewrite does not add trailing slash - LemonStand Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

mod_rewrite does not add trailing slash

#1 User is offline   bunnyyappi 

  • Member
  • Group: Members
  • Posts: 4
  • Joined: 20-October 11

Posted 26 October 2011 - 07:57 PM

Hello,

I just installed LemonStand to a subdirectory named "shop" into my 1and1 hosting shared account.

As per the instruction posted on http://lemonstandapp..._web_installer/, I changed the .htaccess file to include:

RewriteBase /shop

This is the behavior I got:



So the rules aren't working to add the trailing slash...

I am including my complete .htaccess below for your reference:

AddHandler x-mapp-php5 .php

SetEnv DEFAULT_PHP_VERSION 5

RewriteEngine on
RewriteOptions MaxRedirects=1

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

#
# 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|jpeg|gif|css|png|swf|txt|xml|xls)$) [NC]
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
</IfModule>


Thanks,
Rosa
0

#2 User is offline   dardub 

  • Lemonholic
  • PipPipPip
  • Group: Members
  • Posts: 483
  • Joined: 30-August 10

Posted 27 October 2011 - 08:22 AM

I wonder if there are issues with mod_rewrite with your hosting provider.
0

#3 User is offline   bunnyyappi 

  • Member
  • Group: Members
  • Posts: 4
  • Joined: 20-October 11

Posted 31 October 2011 - 07:45 PM

I found that I have to comment out the following line in order for "/shop" to be rewritten to "/shop/"

RewriteCond %{REQUEST_FILENAME} !-d

0

Share this topic:


Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users