How to point all pages of the site to one page?

Asked

Viewed 650 times

2

I am in need of a solution in htaccess that points all pages of the site to a specific page of the 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 point out all the pages to the home because the whole site is in html and the only place I got one .php to redirect to another site was at home.

2 answers

3

You can use:

RewriteEngine on

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

Source

0

I recommend creating a route system as shown here: http://rberaldo.com.br/urls-amigaveis-sem-htaccess-usando-slim/

Your .htaccess will have only this:

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

The rest will be programmed in index.php, who will take care to redirect to the correct location

Browser other questions tagged

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