Shahin Ataei Shahin Ataei - 1 year ago 133
Apache Configuration Question

why index keyword is return empty $_GET on seo url with htaccess in apache 2.4.18?

I use wamp server 3.0.4

my htaccess code is here

AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]

but when i enter this
url = "localhost/myproject/index"

array is empty =

when i enter this
url = "localhost/myproject/second"

array is =
[_url] => /second/

Answer Source

That is due to use MultiViews option turned on. Option MultiViews (see is used by Apache's content negotiation module that runs before mod_rewrite and makes Apache server match extensions of files. So if /index is the URL then Apache will serve matching /index.php.

Turn it off using this line at top of .htaccess:

Options -MultiViews
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download