0
votes
I am just learning mvc structure. In my mvc directory, 
I have a .htaccess file which contains this:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

The idea is to redirect all the requests to index.php like:
http://www.domain.com/mvc/test
will be
http://www.domain.com/mvc/index.php?url=test

It is working fine.

But when I am trying to pass this:
http://www.domain.com/mvc/index
hoping to be converted to
http://www.domain.com/mvc/index.php?url=index

But it is not working.

I’ve seen some tutorial videos where this works.
There must be some settings which I don’t know.
1
Welcome to stackoverflow. Your question is about basic redirect, it has nothing to do with MVC, so I removed mvc tag. Also, avoid horizontal scrolling of your text, it will make it more readable. - user4035
Do you have a directory or file in mvc directory, called "index"? - user4035
I have nothing called "index" in mvc directory. I just want it to treat "index" as any other non-existent phrase and want it to be redirected as '?url=index' as I've mentioned. But it is treating "index" as "index.php" and is not redirecting. - Arka Roy
This video will help you to understand my problem. youtube.com/watch?v=Aw28-krO7ZM - Arka Roy
Sorry, can't watch youtube from this machine. Are you sure, that it's treating index as index.php, it shouldn't do it. Can you redirect to google.com?q=$1 and check? Put R flag to RewriteRule. - user4035

1 Answers

2
votes

Try to disable MultiViews in htaccess:

Options -MultiViews