Skip to content Skip to sidebar Skip to footer

Hide Index.php (or Index.html) Of An Url

When I type the address of my site in a browser (mysite.com), it redirects to mysite.com/index.php. Why not to index.html ? Because I changed it in the conf file in Apache 2.2 . N

Solution 1:

I don't know why you need to use mod_rewrite. On my site I did nothing to hide index.php, I just don't point it anywhere in code, so instead of www.example.com/index.php?task=forum I just write www.example.com/?task=forum. It works on standard apache config.

Solution 2:

If it's redirecting, (by sending a new Location on HTTP header, for example) then there's nothing you can do but changing the code that's doing the redirect.

On the other hand, if your WebServer is Apache, there is a configuration directive that might help:

DirectoryIndex

When you set that to: index.php or index.html, then your web server will automatically redirect to those internal files without changing the URL when you hit the directory on your server where the DirectoryIndex directive is setup.

I guess you'll get better answers if you post this on SERVERFAULT.

Good luck.

Solution 3:

This seemed to work in my environment (would NOT display index.php):

        <form action="." method="POST">
       E-mail: <inputtype='password' size='50' name='email' />
       <inputtype='submit' value='Login' />
    </form>

Solution 4:

You can easily do this with URL mapping in either the http.conf file or individual .htaccess files in your application directories. Turn on mod rewrite. Here is a simple tutorial.

Post a Comment for "Hide Index.php (or Index.html) Of An Url"