Apache does not recognize virtual directory

Asked

Viewed 261 times

1

There is a domain that we have entered into our DNS pointing to our Linux server where we have Apache/Mysql/PHP/Wordpress.

I created the Wordpress folder in /var/www with the name my-site.com.br.

I created the database and users.

I restored the bd backup.

I moved the wrodpress website to the /var/www folder.

In the file . htaccess has:

Rewriteengine On Rewritebase / Rewriterule index.php$ - [L] Rewritecond %{REQUEST_FILENAME} ! -f Rewritecond %{REQUEST_FILENAME} ! -d Rewriterule . /index.php [L]

I set the configuration for bd, user and password in the wp-config.php file.

I made the configuration in /etc/apache2/sites-available, where I created a configuration file my-site.com.br

inserir a descrição da imagem aqui I activated the site in /etc/apache2/sites-enabled via sudo a2ensite.

The problem is that when trying to access the site via browser is redirected to another domain of mine on the same server that has nothing to do.

The displayed domain exists and is on my server, but has nothing to do with the domain I reported in the browser.

I have several sites that made the configuration and works, but this does not want to work.

  • It would be important, you edit the question and put the settings you made! Mainly if the site contains the file .htaccess. Just as it is it is impossible to identify where the error is!

  • @wmsouza I appreciate the help. I am not an expert on the subject, but I had already published other sites and never had problems. What happens is as if the domain I am trying to access did not exist on my server. I access my-site.com.br and returns another-site.com.br. Now if I change the configuration of the other-site.com.br and point to the folder of my-site.com.br works.

  • How is this structure of yours, how many sites have on the same server?

  • @Magichat have a 10 sites. All wordpress and works. Are sites with access in the internal and external network. The old ones work, only the two new ones that always go to the wrong site.

  • There shouldn’t be a tag <VirtualHost>?

  • @Magichat has yes, I don’t know why it wasn’t showing up. But I put an image. I did the process I always do, however the two new sites are not loaded. The others all work.

  • How’s the /etc/hosts ?

  • @Magichat usually do not use '/etc/hosts'. I only create the configuration Arq '/etc/apache2/sites-available' and then create the link in '/etc/apache2/sites-enabled'. And it worked. And better use the host?

Show 3 more comments
No answers

Browser other questions tagged

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