Skip to content

Instantly share code, notes, and snippets.

@Mrshcom
Created October 7, 2012 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mrshcom/3848859 to your computer and use it in GitHub Desktop.
Save Mrshcom/3848859 to your computer and use it in GitHub Desktop.
Redirect all url to .php

Redirect all url (without type) to .php

(Add this code to .htaccess file)

    • => *.php
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([A-z0-9/_+-]+)$ /$1.php [L]
</IfModule>

Redirect all url (with type) to .php

  • *.type => *.php

Look Like this Site [http://www.vojdany.com/amin.1devs] to Redirect for Example amin.1devs(a tag with href="amin.1devs") to amin.php

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f [OR]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([A-z0-9/_+-]+)$.1devs /$1.php [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment