How to remove the index through the site's .htaccess file?

1

Hello, I'm making a website and I would like to remove the index by changing it to another address eg: site.com.br/curitiba - WITHOUT USING CPANEL REDIRECTION.

I'm looking for a solution in .HTACCESS to re-name the index ... but continuing to access the site by the URL MAIN - REMOVE INDEX BY .HTACCESS IS POSSIBLE?

    
asked by anonymous 26.05.2016 / 20:46

2 answers

0

Below you redirect your domain to a subfolder from index.php:

#Redireciona seu site pra uma sub pasta do domímio

Redirect /index.php http://www.site.com.br/curitiba

If you add the code below, you will rewrite all your URLs from index.php:

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        # Remove index.php das URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
        # redireciona suas páginas a partir  de index.php
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
    
26.05.2016 / 21:25
0

The correct way to do this is by passing all the relevance of the index to your landing page (curitiba), if you only do a redirect, you will lose all relevance in the SERPs (google, bing, yahoo , yandex, and others) .

The correct way to redirect is also to say that you should take all the relevance assigned by the search engines to your new landing page.

To do this use the link :

  

RewriteCond% {THE_REQUEST} ^. * / index.php

     

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

     

RewriteRule ^ / $ / curitiba [L, R = 301]

    
12.07.2017 / 18:58