Recent Posts

Caution: Greetings to all visitors. The site is working in short. Links Please skip the link to view any topic and thank you for visiting
header ads

Mod rewrite help

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

Post a Comment

0 Comments