1
At the root of the server I have a folder "wp" where I have Wordpress installed. I put inside the folder because the site was not made with Wordpress and yes the blog.
When typing the url "www.dominio.com/wp" the blog opens without problems, but if type "domain.com/wp" (without www) does not work.
I already tried the solutions I found on Google, for example, edit the . htaccess inside the "wp" folder to always redirect to "www", but it doesn’t work and always redirects from "dominio.com/wp" to "www.dominio.com".
The .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: 21/10/2014
After having access to the control panel in Godaddy, I found that some DNS settings were missing in Godaddy.
The added settings were:
A (host):
@ -> point to its IP
meusite -> point to its IP
www.meusite -> point to the respective IPCname (alias) www -> point to meusite.com
But this implies that the project receives the requisitions from the domain without www, right?
– Rodrigo Rigotti
Yes, as I understand it, he wants to redirect from the domain without the www towards the www, which is also a good practice not to duplicate content.
– Paulo Rodrigues
I get it. In this case we are proposing to solve its problem (which is to respond to both domains) and to redirect the requests from one of the domains to the other. I find the idea valid. :)
– Rodrigo Rigotti
At the root of the site I created htaccess with the above code and when typing domain.com/wp does not redirect par www.dominio.com/wp, then I removed this and edited htaccess inside the wp folder and does not redirect.
– Filipe Moraes
Okay, since you created a new one, you need a
.htaccess
complete. I edited my reply. And if you have access to Virtual Host, @Rodrigorigotti’s solution is simpler.– Paulo Rodrigues
I changed as per your example and "dominio.com/wp" does not redirect to "www". I do not have access to Virtual Host.
– Filipe Moraes
Well, that’s weird because I have a domain that works just like that. Another case of mine and that you can try, is to put this code right above yours, even in
.htaccess
ofwp
. Mine is thus.– Paulo Rodrigues