- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^/([a-z-]{2})/([a-z]+)$ /index.php?lang=$1&p=$2[QSA,L]
It gives me a 404 error. mod rewrite is enabled and working. As you can see, I'm trying to get the language chosen and the page too:
/index.php?lang=en&p=home
to
/en/home
Thanks.
Edit: Yes the extra dash in the first sub pattern is there for a reason. (Any letter and dashes are allowed.)
Edit 2: Nevermind I got it working. Here's the fixed version:
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([a-z]{2})/([a-z-]+)$ /index.php?lang=$1&p=$2 [QSA,L]