user494599
user494599

Reputation:

htaccess url rewrite rule in conflict with folder name

I have the following htaccess:

Options +FollowSymlinks
RewriteEngine on

RewriteRule ^models$  index.php [L]
RewriteRule ^post$  index.php?action=post [L]

and a folder named models.

The problem is: Apache sends me into the folder. With "post" the redirect rule works as there is no folder named post.

EDIT:
I forgot to tell that there is htaccess in models folder too, with:

Deny from all

Upvotes: 0

Views: 626

Answers (2)

Ilyas Serter
Ilyas Serter

Reputation: 850

disable MultiViews in your apache configuration file. adding "Options -MultiViews" to your .htaccess might work too.

Upvotes: 0

Bjørne Malmanger
Bjørne Malmanger

Reputation: 1477

If you can accept a trailing slash after models, I think this would work.

RewriteEngine On

RewriteRule ^models/?$ index.php [L]
RewriteRule ^post$ index.php?action=post& [L]

Upvotes: 1

Related Questions