0

When I write in .htaccess this mod_rewrite

 RewriteEngine on
 RewriteRule ^(.*)\.my_extension$ $1.php

and open url: site.com/index.my_extension this wroks fine, opened index.php

But when I am trying mod_rewrite like this:

 RewriteEngine on
 RewriteRule ^(.*)$ index.php?url=$1

this gives me Internal Server Error.

Why this happened? what is reason?

MadHatter
  • 81,580

1 Answers1

1
RewriteEngine on
RewriteCond %{REQUEST_URI} !(index.php)
RewriteRule ^(.*)$ index.php?url=$1

You have a redirect loop, you need to exclude index.php from the rules.

David Houde
  • 3,240