1

Probably very easy question but I can't get it to work.

Case: The trailing slash will be removed from the URL by the following htaccess line:

RewriteCond %{request_method} ^GET$
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)$ %1 [L,R=301] # <- this line removes the trailing slash
RewriteRule .* index.php [L]

How can I make an exception for this page: mydomain.com/paypal/ipn/ so it won't do a 301 redirect to: mydomain.com/paypal/ipn

alexwlchan
  • 5,699
  • 7
  • 38
  • 49
Martijn van Hoof
  • 740
  • 10
  • 28

1 Answers1

1

You can create an exception using RewriteCond:

RewriteCond %{request_method} ^GET$
RewriteCond %{REQUEST_URI} !^/paypal/ipn/ [NC]
RewriteRule ^(.+?)/$ %1 [L,R=301,NE]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
anubhava
  • 761,203
  • 64
  • 569
  • 643