Domain without the www does not work

1

At the server root I have a "wp" folder where I have WordPress installed. I put it inside the folder because the site was not made with WordPress and yes the blog.

When you enter the url www.domain.com/wp the blog opens without problems, but if you type " domain.com/wp " (without the www ) does not work.

I have tried the solutions I found in Google, for example, edit .htaccess inside the "wp" folder to always redirect to "www", but it does not work and always redirects from "domain.com/wp" to " www.dominio.com ".

.htaccess is as follows:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>
# END WordPress

How do I solve the problem?


UPDATE: 10/21/2014 Home After accessing the control panel on Godaddy, I noticed that some DNS settings were missing from Godaddy.

The settings added were:

  • A (host):
      > point to the respective IP
      myite - > point to the respective IP
      www.meusite - > point to the respective IP

  • CName (alias)   www - > pointing to meusite.com

asked by anonymous 21.10.2014 / 13:02

3 answers

0

After accessing the control panel on Godaddy, I noticed that some DNS settings were missing from Godaddy.

The settings added were:

  • A (host):
      > point to the respective IP
      myite - > point to the respective IP
      www.meusite - > point to the respective IP

  • CName (alias)   www - > pointing to meusite.com

02.06.2017 / 16:56
5

This setting is not the .htaccess , but the virtual host. In the file where you configure your domain (for example, /etc/apache2/sites-enabled/dominio.conf ), just set ServerAlias :

ServerName  www.dominio.com
ServerAlias dominio.com
    
21.10.2014 / 13:15
2

Using .htaccess , if you do not have access to Virtual Host settings, you can have something like this at the root of your domain:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^dominio\.com [NC]
    RewriteRule (.*) http://www.dominio.com/$1 [R=301,L]
</IfModule>

The redirect will be done, regardless of the "directory" you are in.

    
21.10.2014 / 13:20