Answer the question
In order to leave comments, you need to log in
How to redirect htaccess of all .html files to one php file?
Help me figure it out, please.
I do a redirect with a get parameter (it works), I try to add to this code a redirect of all files ending in .html to the same test.php (without a get parameter), but it does not work.
Here is the working code:
RewriteEngine On
RewriteRule ([a-zA-Z0-9_-]+)$ test.php?ticket=$1 [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . test.php [L]
Answer the question
In order to leave comments, you need to log in
Let's say:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)$ ./test.php?route=$1 [QSA]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question