I have a page on my wordpresss with url /sca
. I want all traffic from /sca/project_0
to direct to /sca?urn=project_0
. I added a rule to my .htaccess
file but it is not working. I don't think this a problem with mod_rewrite as permalinks are working. Here is my .htaccess
file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^sca/([^/]*)$ sca/urn=$1
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteRule ^sca/* sca?urn=$1 [R=301,L]
is partly working, only that I'm not getting any parameter, it is returning /sca/project_0
as /sca?urn=
.
sca
vssrc
in your question.RewriteBase
line. The[L]
flag for the other rules mean "last", Apache will ignore yours where it is at the moment.