I did mistake and didnt change my root URL when started work with WordPress, for now I have my blog with about 30 pages and I need change root URL.
-
My wordpress located:
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\wordpress -
My blog stays as theme under:
...\htdocs\wordpress\wp-content\themes\myblog -
My domain URL:
http://www.myblog.co.il/wordpress/wp-admin -
index.phplocated:...\htdocs\wordpress\wp-content\themes\myblog\index.php
when I run my main page aka index.php I see http://www.myblog.co.il/wordpress
therefore all generated permalinks look like:
http://www.myblog.co.il/wordpress/?page_id=158 … .
The main quiestion is: How to change:
http://www.myblog.co.il/wordpress to ‘http://www.myblog.co.il/‘ in order to change automatically all permalinks? a.e. http://www.myblog.co.il/?page_id=158 …
I saw enough solutions how to do that from start but not when blog is ready.
Please, help me to find proper solution.
Thanks,
Well first of you’ll have to configure a virtual host in Apache to match the domain to your htdocs\wordpress folder and not just to \htdocs. You can read more on vhosts in apache here.
Since WordPress saves all URLS in their absolute form to the database, you’ll have to manually fix this by replaceing the URLS in the database. Assuming you’re running MySQL and the current URL to your blog is http://www.myblog.co.il/wordpress, you can use these queries:
this does not only fix hardcoded links but it also fixes custom links inside the content of your pages and posts.