0
votes

In wordpress admin panel, settings/general, I changed the "site URL" from site.com to www.example.com

so now I have:

WordPress Address (URL) : http://example.com

Site Address (URL): http://www.example.com

(Wordpress in installed on root)

But I have problems because it's clear that paths are not correctly read from code: site is visible but but icons fonts is not visible admin have problems and so on...

I asked to disable openbase_dir option to my provider Nothing changed I tryed to add

RewriteCond %{HTTP_HOST} ^(www.)?example.com$

but not all was fixed...

Anyone could help me please? thank you !!!

.HTACCESS

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

# END WordPress

RewriteCond %{HTTP_HOST} ^(www.)?example.com$
2
Moving a WordPress installation is documented here: codex.wordpress.org/Moving_WordPress (yes, changing site.com to www.site.com is a move). - Gerald Schneider
yes I read all and tryid all but it's not working ....it's the second time (2 blogs) that I need to change it but the wordpress guide it's not working everytime you need to make some fix - antony

2 Answers

0
votes

in your theme don't use static URLs at all, always use the_permalink() for posts, and use bloginfo( 'template_url' ); for style sheet and javascript references.

for me I never change the URL from admin panel, I always export the DataBase into .sql file when I'm done development, then open this .sql file with notepad++ and replace all 'localhost/wpexamplesite' occurrences with 'www.mywebsite.com'.

I have been doing this for many years, and it works every time.

one more thing, if your server is in the same local network as your pc, then try changing your DNS to google's 8.8.8.8, sometimes the system admins in office networks make the mistake of redirecting aliases of www.example.com and example.com to different servers.

0
votes

After many hours and many settings, I discover that if you want to change your wordpress blog from

not-www to www

you need ONLY to change in settings page / generale both the fieds, not only 1!!!

So in this way:

from:

WordPress Address (URL) : http://example.com

Site Address (URL): http://example.com

to

WordPress Address (URL) : http://www.example.com

Site Address (URL): http://www.example.com

that's all!

ATTENZION: Do not touch the 1° field (Wordpress address) if you want to change the directory and read the wordpress guide!