ReweriteRule to get all sites without .php

Discussion in 'Apache' started by dafuqjoe, Apr 17, 2013.

  1. #1
    Hey!

    So I was trying to get used to some rewriting in the .htaccess file.
    But I just don't get it.
    I simply want all URL's to get reached also without the .php extension.
    index.php as index
    login.php as login
    etc.

    It should also include all given parameters
    index.php?id=81 as index/81
    login.php?u=example&try=3
    as login/u=example&try=3

    or similar...

    Currently I got this:

    RewriteEngine On
    RewriteBase /
    RewriteRule login login.php
    RewriteRule index/(.*)$ index.php?i=$1
    Code (markup):
    Using this code I get redirected from
    /pics/fblogin.png to the login.php???
    Why does it redirect me??? Does this redirect every link containing "login" to the login.php?

    Thank you!
     
    dafuqjoe, Apr 17, 2013 IP