Answer the question
In order to leave comments, you need to log in
How to properly configure htaccess for mvc (php)?
There is MVC
How data is passed for the controller
RewriteRule ^([^/]*)/([^/]*)$ index.php?route=$1/$2 [L]
$1 - controller
$2 - view
For example user/cabinet
What do I need
So that when typing in the url mysite.com/ hello
, the
controller and view I need are connected
You can do this
RewriteRule ^(hello)$ index.php?route=controller/view [L]
But for me this is not quite suitable
Since instead of hello - maybe be any text. (not known in advance)
I think the problem itself lies somewhere here
RewriteRule ^(.*)$ index.php [F,L]
I searched, read, watched, tried - but I don't have enough knowledge to understand.
At the controller, I will check, if there is no information in the database, then I will output to the main page controller.
Answer the question
In order to leave comments, you need to log in
Once again I say, I don’t know how many times I repeated the GET parameter is not part of the url, to redirect with GET you need to use a different construction.
all converge to one.
RewriteCond %{REQUEST_URI} /test/
RewriteCond %{QUERY_STRING} ^id=229
RewriteRule ^.*$ /supermodel/? [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question