I am struggling to achieve this simple thing...
I have some static pages which should be like
www.domain.com/profile etc..
The problem is how to write the rewrite rules in order to ..
There would be some fixed rewrites like /home
I want every file that exists not to be rewritten www.domain.com/test.php should go to test.php
Lastly if it is not found i want it to be redirected to static.php?_.....
RewriteRule ^/home/?$ /index.php?__i18n_language=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/([^/]+)/?$ /static.php?__i18n_language=$1
This works ok but if i type index.php or test.php or even the mach from other redirection it gets me in static.php... Please help!
First of all, your
is using a parameter ($1) ... but there is nothing in the first section that defines what that parameter should be.
The second section
is missing [L], which is a good idea to have
uses request url as a parameter to i18n which means it works something like: example.com/login/ -> /static.php?__i18n_language=login
Can you give some more examples of what kind of urls you are trying to query, what you expect to happen, and what you see happening?
You might want to use the RewriteLog Directive to create a log and try to debug your mod_rewrite problems.