Hi all,
I have a requirement to change all underscores to dashes, well I have achieved that with these two lines:
RewriteRule ^([^_]*)_(.*)$ /$1-$2 [R=301,L]
RewriteRule ^([^_]*)_([^_]*)$ /$1-$2 [L,R=301]
However now I need to restrict these rules to only apply to a certain page "help.php" (its in the root directory)
I thought this might do the trick:
<If "%{REQUEST_FILENAME} ^help/.php$">
RewriteRule ^([^_]*)_(.*)$ /$1-$2 [R=301,L]
RewriteRule ^([^_]*)_([^_]*)$ /$1-$2 [L,R=301]
</If>...
Mod rewrite help
from Apache https://ift.tt/36EAXtE
via IFTTT

0 Comments