logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: htaccess issue with rewrite rules/ conditions
Author
zxlg



Joined: 19 Jul 2017
Posts: 2
Location: USA, Tampa

PostPosted: Wed 19 Jul '17 18:07    Post subject: htaccess issue with rewrite rules/ conditions Reply with quote

Hi,

I am trying to remove the trailing slash from certain pages. However, I am having issues with the Rewrite conditions. The trailing slash is removed from: /checkout/onepage/success/ and it should not be. I have the following added to my htaccess file of my website root folder.
I am running Apache version: 2.4.27 in an environment using cpanel 64 and Centos 6.9. Any thoughts on the issue are appreciated.

Code:

## enable rewrites

Options +FollowSymLinks
RewriteEngine on

#direct all traffic to https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

#trailing slash policy
RewriteCond %{REQUEST_URI} !^/index.php/
RewriteCond %{REQUEST_URI} !^/contactus/
RewriteCond %{REQUEST_URI} !^/customer/
RewriteCond %{REQUEST_URI} !^/checkout/
RewriteRule ^(.*)/$ /$1 [L,R=301]]
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Sun 23 Jul '17 17:10    Post subject: Reply with quote

is the setting AllowOverride All ?
Back to top
zxlg



Joined: 19 Jul 2017
Posts: 2
Location: USA, Tampa

PostPosted: Tue 25 Jul '17 20:46    Post subject: Reply with quote

Thanks for your reply.
I asked the hosting company and they said that AllowOverride is set to All in the apache configuration.
Back to top


Reply to topic   Topic: htaccess issue with rewrite rules/ conditions View previous topic :: View next topic
Post new topic   Forum Index -> Apache