Here’s my problem, I have a bilingual website nd I don’t know how to manage the urls.
I would like
- mydomain.tld/contact-us and mydomain.tld/nous-contacter to show contact-us.php
- mydomain.tld/pricing and mydomain.tld/prix to show pricing.php
- mydomain.tld/pricing/item1 and mydomain.tld/prix/item1 to show pricing.php?what=item1 (for this one I’m not sure how to handle that, any hint is appreciate).
I can do the case one and two with ease with:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/\.]+)/?$ $1.php [R] # R for debug, make sure it shows the right page
But I don’t want to have 10 entries for 5 pages, and this is not a secure way.
It would be great if (maybe) I can do something like: (contact-us|nous-contacter) as a condition. Still not sure if this is possible and if it is, if its the easiest and most secure way to do it.
How can I do this?
1 Answer