How to point all pages of the site to a single page?

2

I need a solution with htaccess that points all pages of the site to a specific page of type:

http://meusite.com.br/pagina1.html -> http://meusite.com.br/index.php
http://meusite.com.br/pagina2.html -> http://meusite.com.br/index.php
http://meusite.com.br/pagina3.html -> http://meusite.com.br/index.php
http://meusite.com.br/pagina4.html -> http://meusite.com.br/index.php
http://meusite.com.br/pagina5.html -> http://meusite.com.br/index.php

I would like to point all pages to home because the whole site is in html and the only place I got a .php to redirect to another site was at home.

    
asked by anonymous 07.08.2015 / 02:22

2 answers

3

You can use:

RewriteEngine on

RewriteRule ^(.*)$ /index.php [R=permanent,L]

Font

    
07.08.2015 / 06:24
0

I recommend creating a route system, as shown here: link

Your .htaccess will only have this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

The rest will be set to index.php , which will take care of redirect to the correct location

    
12.08.2015 / 14:29