menu

arrow_back How to create .htaccess rule?

by
1 vote
I have in the file .htaccess there is a rule

RewriteRule ^(.*)?$ material/ru.php [QSA,NC,L]
It sends all non-existing pages of the form site.ru/123456 at material/ru.php

How to make the same rule but not for existing pages with addresses:

site.ru/ view/123456 to these addresses are processed the rule is different from

RewriteRule ^(.*)?$ material/ru.php [QSA,NC,L]
and open the following address material/ en.php

Thank you!

1 Answer

by
 
Best answer
0 votes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^view/ material/en.php [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ material/ru.php [L]