I have a custom URL like this:
website.com/show/?id=9999&n=page-name
and I'm trying to come up with a mod_rewrite
rule to convert to
website.com/show/9999/page-name/
/show/
is a page name.
Here's the rules I'm using in .htaccess:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^show/(.*)$ /show/?id=$1 [R=301,NC,QSA]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
This is working, it rewrites
website.com/show/?id=9999`
to
website.com/show/9999/
Then I modified the rule for the second query string:
RewriteRule ^show/(.*)/(.*)$ /show/?id=$1&n=$2 [R=301,NC,QSA]
But website.com/show/9999/page-name/
returns a 404 error.
It works if I go to: website.com/show/9999/?n=page-name
.
What am I doing wrong?