1

Here is my .htaccess for simple url rewriting for any MVC architecture.

Options +FollowSymlinks

RewriteEngine On
RewriteBase /personal/site/

RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

Every thing is working only one exception rises. On the root where index.php exists i created a file generator.js, i also do have a controller named generator.

So for a request, http://localhost/personal/site/generator/css,

it must rewrite it to http://localhost/personal/site/index.php/generator/css

But it is rewriting it to http://localhost/personal/site/generator.js/css

How to resolve this scenario?

2
  • There is only one rewrite rule in your question and it can't produce the effect you describe. You might want to have a look around for another rewrite rule.
    – Ladadadada
    Dec 27, 2011 at 11:40
  • Can you please suggest me what other rule i should add to get my effect? Dec 27, 2011 at 12:10

1 Answer 1

1

I got solution from stack-overflow and the solution is to Turn of multiviews.

Options -MultiViews

This solved the problem.

The credit goes to https://stackoverflow.com/users/567986/gerben

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .