: Htaccess Redirect everything to index.php little trouble I need to redirect everything (www.example.com/, www.example.com/en/, www.example.com/en/index.php?do=xyz, etc.) to index.php, but I can't get
I need to redirect everything (www.example.com/, example.com/en/, example.com/en/index.php?do=xyz, etc.) to index.php, but I can't get everything working.
1st try:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /index.php?path= [NC,L,QSA]
works, but stylesheets href="css/xyz.css" don't load if I use example.com/en/. I would need to change them to href="/css/xyz.css" and I won't.
2nd try:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z]{2})/(.*) [QSA]
RewriteRule ^([^/]*)$ index.php?op= [L,NS,QSA]
This works, CSS files are ok, the only bad thing is that jquery $.get can't find the files so I think I am missing something on the way.
And maybe I could do everything using only one RewriteRule?
Any suggestion?
More posts by @Shelley277
1 Comments
Sorted by latest first Latest Oldest Best
After some trys and searches I got it working using:
RewriteCond %{DOCUMENT_ROOT}/ -f [OR]
RewriteCond %{DOCUMENT_ROOT}/ -d
RewriteRule ^([a-z]{2})/(.+)$ / [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.