I’ve a customized URL like this:
web site.com/present/?id=9999&n=page-name
and I am attempting to give you a mod_rewrite
rule to transform to
web site.com/present/9999/page-name/
/present/
is a web page identify.
This is the foundations I am utilizing in .htaccess:
<IfModule mod_rewrite.c>
Choices -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^present/(.*)$ /present/?id=$1 [R=301,NC,QSA]
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
That is working, it rewrites
web site.com/present/?id=9999`
to
web site.com/present/9999/
Then I modified the rule for the second question string:
RewriteRule ^present/(.*)/(.*)$ /present/?id=$1&n=$2 [R=301,NC,QSA]
However web site.com/present/9999/page-name/
returns a 404 error.
It really works if I am going to: web site.com/present/9999/?n=page-name
.
What am I doing fallacious?