Hi,
Just can't figure aout those regular expressions.
I have an .htaccess file with some url rewrites. Look below what I have now:
RewriteRule ^news news/ [R]
RewriteRule ^news/([-A-z0-9]+)/$ news/$1 [R]
RewriteRule ^news/([-A-z0-9]+)$ index.php?news=$1 [L]
I don't think this is correct, I mean I think it could be better.
This is what they have to do.
- If visitor visits www.mydomain.com/news or www.mydomain.com/news/ he shlould be redirected to www.mydomain.com/index.php
- If visitor visits www.mydomain.com/news/test-slug or www.mydomain.com/news/test-slug/ he shlould be redirected to www.mydomain.com/index.php?news=test-slug
- The slugs only contain letters (A-Z and a-z), numbers (0-9) and dashes "-", so I need a correct regex for this
Can someone help me to build the correct rewrites?
Greets, Nick