How do I type this url into . htaccess to get a friendly url?

Asked

Viewed 204 times

0

  • 5

    http://answall.com/questions/53973/url-amig%C3%A1vel-como-fazer-funcionar-com-htaccess

2 answers

1


I’m not an expert in PHP, but I think it solves.
Put in your .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
  • The link @jbueno posted has much more details, had not seen the comment before responding.

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 file .htaccess in admin folder like this:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.