Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add an exception to .htaccess RewriteRule

I added the folowing code to main .htaccess

# BEGIN
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)/[0-9]+/?$ /$1/? [L,R=301]
# END

I'd like to add an exception to any link ended with .../page/

like image 417
philip76 Avatar asked May 01 '13 09:05

philip76


1 Answers

If all you need is to exclude requests with /page in the URI-path, you may try this:

RewriteCond %{REQUEST_URI} !/page [NC]
RewriteRule ^(.*)/[0-9]+/?$ /$1/? [L,R=301]
like image 70
Felipe Alameda A Avatar answered Sep 27 '22 23:09

Felipe Alameda A