Redirecting the root URL to a directory . htaccess

Asked

Viewed 80 times

1

I have the following domain: https://aulasprofdanilo.com.br

When accessing it it is possible to observe that it directs to the following screen (see below): inserir a descrição da imagem aqui

In order to access my teaching platform, I need to click Moodle or type in the browser https://aulasprofdanilo.com.br/moodle to be able to access directly.

I know I need to do a redirect with . htaccess and I did it using the following code:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^aulasprofdanilo.com.br$ [OR]
RewriteCond %{HTTP_HOST} ^www.aulasprofdanilo.com.br$
RewriteRule ^(.*)$ https://aulasprofdanilo.com.br/moodle/$1 [R=301,L]

I saved this file . htaccess in the directory: /var/www with the name redirect.htaccess. However, it does not work.

My question is:

How do I type in the browser https://aulasprofdanilo.com.br and internally direct Apache to https://aulasprofdanilo.com.br/moodle?

  • you need to leave the file name as .htaccess only.

  • @Kleberoliveira thank you so much for answering. I did what you told me, now appears the message that the redirect is incorrect. What can I do?

No answers

Browser other questions tagged

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