Is it possible to configure a Rewrite Rule in AWS without changing the directories?

Asked

Viewed 220 times

1

I have a small problem since I set up the AWS. The fact is that it came a little prepared when it fell into my hand.

It is configured to save in the domain.com.br/site/wordpress, and when trying to access this link only by domain.com.br I end up falling in the AMI Linux Test Page.

Is it possible to create a Rewrite Rule so that the domain.com.br points inside wordpress? Moving directories now would be a little more complicated, but I also accept a help.

Consider that I have already tried some Rewrites, but none of them has definitely worked.

  • Dude, I think your problem is just reconfiguring the virtual host pointer to the directory you want. Vc creates or edits a host virtal for the domain you want, from the documentRoot you point to the desired directory. I do not know how to do by AWS panel, I find a little polluted panel, but I know how to do the configuration in apache. If that’s what you need, let me know.

  • Diego, that’s exactly it. The AWS Panel is extremely confusing and I’ve been racking my brain to try to make it work.

1 answer

0


I assume you are using Ubuntu and apache2.4, so maybe your virtual host configuration files are stored in /etc/apache2/sites-enabled/teudominio.com.br.conf Edit your . conf file with the data below. Just note that the path in Documentroot and Directory Path should be the corresponding paths on your server.

<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot /var/www/html/dominio.com.br/site/wordpress
  ServerName   dominio.com.br
  ServerAlias  www.dominio.com.br
  <Directory /var/www/html/dominio.com.br/site/wordpress>
    Options +ExecCGI +FollowSymlinks -Indexes
    Require all granted
  </Directory>
</VirtualHost>
  • Diego, thank you very much for the answer, it worked perfectly. I even considered changing to /var/www/html, but I think it was more "beautiful" with rewrite.

  • This way you can add more domains to your server. Just create new Virtualhost

Browser other questions tagged

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