Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.