Code: Select all
RewriteEngine on
RewriteRule ^([A-Za-z].*)/ index.php?query=$1 [nc]
1) How do I make exceptions with Rewrite?
2) What RegEx can I use to check if the given URL has a valid file extension at the end?
Thanks in advance
Moderator: General Moderators
Code: Select all
RewriteEngine on
RewriteRule ^([A-Za-z].*)/ index.php?query=$1 [nc]
I have never used Apache's mod_rewrite, but the regex you posted:aliasxneo wrote:So I have some rewriting in my .htaccess but I wish to make an exception. First of all, how do I make an exception? What I mean is let's say if the url is pointing to an EXE file than I want it to process like normal and ignore all rewriting rules below it. Here's what I currently have:
What I want to do is for all requests that have a valid file extension at the end of them, process them like normal instead of passing them to /index.php. So my questions are:Code: Select all
RewriteEngine on RewriteRule ^([A-Za-z].*)/ index.php?query=$1 [nc]
1) How do I make exceptions with Rewrite?
2) What RegEx can I use to check if the given URL has a valid file extension at the end?
Thanks in advance
Code: Select all
^([A-Za-z].*)/Code: Select all
^.*\.(?!exe$)\w*$