redirecting with htacess

Asked

Viewed 56 times

1

Guys set up my htacess to pick up any word I type in the URL and search for the php file.

It works like this: www.meusite.com.br/City and it redirects to www.meusite.com.br/Search/City.php

The code goes like this:

 RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) Search/$1.php/ [QSA,L]

Well what I need to do is, when the file is not found, htacess has to send to error page.html

How do I do that?

1 answer

0


You’ve tried it this way:

ErrorDocument 404 /erro.html

So, when your file is not found, the htaccess will redirect to a custom 404 error page instead of the default 404 apache page.

  • Fernando, can you explain this line of code? So the answer is more complete, otherwise it is a comment/question only...

Browser other questions tagged

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