Redirect URL to another physical folder with . htaccess

Asked

Viewed 7,595 times

1

On the Ubuntu server, I have a physical folder:

/var/www/html/gestao/site/temp/

I wish my .htaccess redirect to the URL domain.com.br/gestao for this physical folder transparently.

2 answers

1


I had to redirect as follows, unfortunately the URL also changes. But it solved my problem.

RewriteEngine On
Redirect 301 /gestao http://www.domain.com.br/gestao-sys/site/adm/

The physical folder management does not exist (which will be typed in the URL). Then it will be redirected to the above physical path.

0

See if this solves your case!

RewriteEngine on
RewriteBase /
RewriteRule ^/gestao/site/temp/(.*)$ http://www.seusite.com/gestao/$1 [R=301,L]
  • Nothing happens. As if you were ignoring the rule. I know that apache is accepting the rules, because I have been doing tests and changes happen, but not the expected.

  • It would not be the other way around, identifying Domain.com.br/gestao redirects to the folder, as it is in the question?

Browser other questions tagged

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