GSTAR
(Omzy83)
1
Is it possible to create a "universal" static pages URL rule?
For example, I currently have the following:
'<view:(about-us|faqs|terms-conditions|privacy-policy|accessibility|cookie-policy)>'=>'site/page',
I have tried the following:
'<view:(\w+)>'=>'site/page',
But it does not work. Anyone got any idea how to do this?
alirz23
(Alirz23)
2
I just tested it and it works, remove the parenthesis
'<view:\w+>'=>'site/page',
GSTAR
(Omzy83)
3
OK that does work but it does not seem to work on pages with a hyphen in the URL, e.g:
‘about-us’ - does not work
‘about’ - does work
Also this rule will also match on non-static pages, so you need to create specific rules for all other pages.
alirz23
(Alirz23)
4
you can include the hyphen in the regex it will match that too
'<view:[\w-]+>'=>'site/page',
I would prefix it with page like so
'page/<view:[\w-]+>'=>'site/page',
still clean and everything works