Here is my current .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f [NC,OR]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^$ /launcher/index.html [L]
RewriteRule ^en/admin$ /main/index.php?lang=en&action=acp [L]
RewriteRule ^sp/admin$ /main/index.php?lang=sp&action=acp [L]
RewriteRule ^en/(.*)$ /main/$1?lang=en [L]
RewriteRule ^sp/(.*)$ /main/$1?lang=sp [L]
I have a launcher screen (which is working fine), and my site PHP files which is main/index.php. I use $_GET to pass information about what page to my index.php ie: index.php?action=download&file=123. There are two root levels I'm going to use /en/ for english, and /sp/ for spanish. These are passed to index.php as ?lang=en or ?lang=sp.
I have 2 problems that I cannot fix;
My rules have a strange inconsistency of failing. There's probably a better way of doing what I'm trying to do. I'd highly appreciate if someone can show me how. I'm a complete noob at mod_rewrite
When I add more things to the end of the URL using a ?variable=value, it occurs after ?lang=en or ?lang=sp. This means that the second question mark causes $_GET to glitch, and those $_GET passed variables are lost. I need a way to append two $_GET together with mod_rewrite?
No comments:
Post a Comment