Redirect - User-Friendly URL . HTACCESS

Asked

Viewed 272 times

0

I created a domain redirect to a subfolder, look how it turned out:

# Redirect from www to non-www location
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.meusite.com.br [NC]
RewriteRule ^(.*)$ https://www.meusite.com.br/loja/$1 [R=301,L]

Worked perfectly!

The problem is that I need to access another subfolder, which is www.meusite.com.br/administrar, but when entering I am redirected to www.meusite.com.br/loja/administrar

Any suggestions ?

1 answer

-1

I got a solution, see below:

# REDIRECT LOJA
<ifmodule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REQUEST_URI} !^/administrar/ [NC]
 RewriteRule (.*) http://meusite.com.br/loja/ [R=301,L] 
</ifmodule>

Browser other questions tagged

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