Answer the question
In order to leave comments, you need to log in
How to write a Rewrite rule?
We have:
RewriteRule ^([^/]*)/?$ index.php?module=category&url=$1 [L,QSA] #RewriteRule category
^([^/]*)/([^/]*)/?$ index. php?module=page&url=$1 [L,QSA] #category/category page
RewriteRule ^/?$ index.php?module=page&url=main [L,QSA] #main page
Answer the question
In order to leave comments, you need to log in
RewriteEngine on
RewriteRule ^admin($|/) - [L]
RewriteRule ^$ index.php?module=page&url=main [L,QSA]
RewriteRule ^([^/]*)/?$ index.php?module=category&url=$1 [L,QSA]
RewriteRule ^([^/]*)/([^/]*)/?$ index.php?module=page&url=$1 [L,QSA]
I once had a similar problem. Here is an alternative option, in addition to the proposed one - add the following lines before your rules:
RewriteCond %{REQUEST_URI} "admin/" [OR]
RewriteCond %{REQUEST_URI} "admin"
RewriteRule (.*) $1 [L]
RewriteRule
line before each of yoursRewriteCond %{REQUEST_FILENAME} !-d
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question