Keep Server Online
  
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
  
or
  
 
  
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.
 |    |   
 | 
     Topic: htaccess issue with rewrite rules/ conditions | 
 |   
| Author | 
  | 
 
zxlg
 
 
  Joined: 19 Jul 2017 Posts: 2 Location: USA, Tampa
  | 
 Posted: Wed 19 Jul '17 18:07    Post subject: htaccess issue with rewrite rules/ conditions | 
     | 
 
  | 
 
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: 7443 Location: EU, Germany, Next to Hamburg
  | 
 Posted: Sun 23 Jul '17 17:10    Post subject:  | 
     | 
 
  | 
 
| is the setting AllowOverride All ? | 
 
  | 
 
| Back to top | 
 | 
 
zxlg
 
 
  Joined: 19 Jul 2017 Posts: 2 Location: USA, Tampa
  | 
 Posted: Tue 25 Jul '17 20:46    Post subject:  | 
     | 
 
  | 
 
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 | 
 | 
 
 
 
 
 | 
 
 
 |  
 
 |  
  |   
 |