How to write this url in .htaccess to get a friendly url? [duplicate]

0

I need to write an instruction in .htaccess to get this url in a friendly format. This is it:

link

... I need to become:

link

You do not understand anything about .htaccess

Thank you

    
asked by anonymous 06.11.2015 / 12:18

2 answers

1

I'm not a PHP expert, but I think that will do.
Put in your .htaccess :

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
    
06.11.2015 / 12:29
0

According to the URL you want, you could do it this way:

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ views/$1.php

</IfModule>

Where would you have to put the .htaccess file in the admin folder like this:

    
06.11.2015 / 13:06