Forum Moderators: phranque
I have a mod rewrite that looks like this in the .htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)/(.*)\.htm$ /index\.php?section=$1&sub=$2
RewriteRule ^(.*)\.htm$ /index\.php?section=$1
Now, I thought that a url like:
site.com/section/sub.htm
would generate a:
site.com/index.php?section=section&sub=sub
since the first rule should apply first.
However, when typing the example url, it generates a:
site.com/index.php?section=index.php/sub&sub=
If I remove the second rule, it generates fine.
How come the second rule have superior priority, when the first rule comes first?
Thanks
David
RewriteRule ^([^/]+)/([^/]+)\.html?$ /index\.php?section=$1&sub=$2
RewriteRule ^([^/]+)\.html?$ /index\.php?section=$1