Forum Moderators: phranque
i have a old pages and their names like
something-like-this.php
and i want to send them a variable using re write mode but i can't figure out rule...
RewriteRule ^([0-9A-Za-z])-(*.).htm$ $2.htm?var=$1
so i want my page name like below
var-something-like-this.php
but it doesn't work...
i think there is hyphen problem, What am I doing wrong? or another suggestions?
Please consider also i have another pages have more than 3 hyphen.
Thanks
My google friendly site has a lot of pages like
page-name-page-name-page-name.php
or
page-name-page-name-page.php
or
page-name-page.php
or pagename.php
as you see they contain different number of hyphen.
i want to send some of them special variable for example
page-name-page-name-page-name.php?var=view-24
so their name must be change to
view-24-page-name-page-name-page-name.php
or
view-24-page-name-page-name.php
or
view-24-page-name.php
But long or short names cause problem while writing ReWriteRule
How can i keep page names with hyphens and add them keyworda that contain hyphen?
Something like:
# handle "view=24" case
RewriteRule ^(view-[0-9]+)-([^.]+)\.htm$ $2.htm?var=$1 [NC,L]
# handle other cases
RewriteRule ^([0-9a-z]+)-([^.]+)\.htm$ $2.htm?var=$1 [NC,L]
Jim