Forum Moderators: phranque
i do have a problem with mod_rewrite.
I have a multi language homepage, where the different files are located in subdirectories /ger and /engl .
Now what iīve done is that i want to redirect everything behind the URL to the subfolder /ger if itīs not a file.
RewriteEngine On
RewriteBase /ger
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule ^(.*)$ index.php [R=301,L]
This works fine.
But how can i check if a certain file exists in the subdirectory /ger?
When i enter [mydomain.org...] (p_solenoids.php DOES exist in /ger/) i want apache to check if p_solenoids.php exists in /ger and then redirect to this file.
i tried adding following before the above RewriteCond:
...
RewriteCond ger/%{QUERY_STRING} -f
RewriteRule ^(.*)$ /ger/%1 [L]
...
but this doesnīt work. I end up in /ger/index.php
Can anyone give me a hint, whatīs wrong? I also tried {REQUEST_FILENAME}, but this is the absolute filepath, i canīt use for my purpose.
thx