-if the language is english or unset the urls will be / (BASE)
-if the language is set the urls will be /it/ OR /fr/
Example link:
mydomain.com/about-us.html
mydomain.com/it/about-us.html
mydomain.com/fr/about-us.html
I made this, but i dont really like how it works:
- Code: Select all
RewriteEngine on
RewriteRule ^([A-Za-z0-9-]+)\.html$ page.php?name=$1
RewriteRule ^(it|fr)/([A-Za-z0-9-]+)\.html$ page.php?lang=$1&
RewriteRule ^projects/([A-Za-z0-9-]+)\.html$ projects.php?name=$1
RewriteRule ^(it|fr)/projects/([A-Za-z0-9-]+)\.html$ projects.php?lang=$1&page=$2
RewriteRule ^photos/([A-Za-z0-9-]+)-([0-9]+)\.html$ photos.php?name=$1&id=$2
RewriteRule ^(it|fr)/photos/([A-Za-z0-9-]+)-([0-9]+)\.html$ projects.php?lang=$1&page=$2&id=$3
Is there a better way, because i have like 50 more rewrite rules to do and i dont want to duplicate them all? I need to set the /en/ and the /it/ optional.