Create friendly URL so that the name of the file does not appear

0

How can I configure the htacces file so that the URL of my website is not www.dominio.com/index.php, but only www.dominio.com, it is a static website with no internal pages.

    
asked by Harles Pereira 22.03.2018 в 01:20
source

1 answer

0

You can define in htaccess that the rule for index.php is overwritten to become the default homepage on your site:

RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

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

If it does not work, check if your hosting provider does not have a htaccess configuration module that overwrites the rules you define in your file.

Greetings.

    
answered by 22.03.2018 / 02:12
source