Answer the question
In order to leave comments, you need to log in
Mod_rewrite and PHP. How to make a single entry point?
Ran into a problem while writing a single entry point with Mod_rewrite and PHP.
.htaccess code
AddDefaultCharset UTF-8
Options -Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?route=$1 [QSA,L]
$route=$_GET["route"];
Answer the question
In order to leave comments, you need to log in
The meaning of the front controller is precisely that you do not have a contacts.php file, but have classes, objects and methods that are loaded depending on the route.
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php\?route=$1 [QSA,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question