RewriteEngine not rewrite url locally?

Options +FollowSymlinks

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f # not a file
RewriteCond %{REQUEST_FILENAME} !-d # not a directory
RewriteRule ^(.+)$ index.php?params=$1 [L]

as you can see i'm trying to convert something like

mysite.com/x/y/z

to

mysite.com/index.php?params=x/y/z

however it does not work. I tried mysite.com/home and set a breakpoint on the first line in index.php, but got 404.

any ideas as to why this is not working for me? thanks for anything!

+3
source share
2 answers

It seems that either is mod_rewritenot installed, or not included, or that you installed AllowOverride-directive for a specific directory in None. Change it (at least)FileInfo

+1
source

First, make sure that it is mod_rewriteenabled on the Apache server.

:

# not a file
RewriteCond %{REQUEST_FILENAME} !-f
# not a directory
RewriteCond %{REQUEST_FILENAME} !-d

Apache:

, "#" , . .

+5

Source: https://habr.com/ru/post/1788878/


All Articles