hello,

I want to hide the extension file in address bar.

Example: www.aaa.com/index.php and it should be like this www.aaa.com/index

Please let me know anyone waiting for ur response..

This is my .htaccess file in website

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME}.php -f

RewriteRule (.*)$ $1.php

regards,
simbu.

    bradgrafelman;11017405 wrote:

    One way:

    Options +MultiViews

    See MultiViews in the Apache docs for more info on what that does.

    Now there is no change in my url.I am getting with .php or .html extensions.

    Could somebody tell me whats the problem?

    regards,
    simbu.

      Write the URL without the file extension.

      .htaccess can help find the file when you leave the extension off, but only the user can decide what to write in the address bar.

      Likewise, change all your links to omit the file extension.

        If you type in a particular url and your server is configured to respond to that url without redirecting, then the url is going to stay unchanged.

        If you want a request to that url to redirect the user somewhere else, you'll need to either alter index.php to redirect the user:

        header("location index");
        exit;
        

        Or you'll need to set up some appropriate mod_rewrite directive. Offhand, I don't know what that would look like.

          4 days later

          You can also using Apache type directives (like ForceType) to force a file without an extension to be parsed as, say, PHP.

            Write a Reply...