How to modify the URL of www.meusite.com/index.php? secao=quemsomos para www.meusite.com/quemsomos?

Asked

Viewed 56 times

2

My file . htaccess is this way:

RewriteEngine ON

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?secao=$1

I want to translate the url www.meusite.com/index.php? secao=quemsomos for www.meusite.com/quemsomos

Is it correct the way I put it? Because it’s not working.

  • what’s wrong? see this link http://blog.thiagobelem.net/learning_urls_friendlies.

1 answer

0

The rule works correctly, but these two conditions:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

mean that the file (-f) does not exist and the folder (-d) does not exist, and must be fulfilled to perform the rewrite.

You probably have a folder called /quemsomos, then the rewriting doesn’t apply.

Remove or rename this folder or remove this condition.

Browser other questions tagged

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