apache - Moving Wordpress site to /blog domain -


i have client wordpress site located on example.com, however, want custom website on example.com , blog moving example.com/blog

so far have created 2 folders in root directory

/main /blog 

in virtual host, have alias blog

alias /blog /var/www/public_html/blog 

the main site located in /main folder , seems working fine. wordpress site has been moved /blog folder , when goto /blog indeed load up.

two problems

1) style sheets aren't loading wordpress site. in source appear example.com/wp-content/... rather example.com/blog/wp-content/...

2) links appear correct don't goto desired place. example category named clothing appears example.com/blog/category/clothing/ when clicked redirects example.com

update

in wp-options table updated siteurl , home values include /blog solved issue 1. issue 2 remains.

update

the problem appears virtual host alias. /blog catches , goes public_html/blog folder, /blog/anything doesn't catch , goes /main folder.

update , solution

the problem .htaccess within wordpress site.

this original .htaccess

<ifmodule mod_rewrite.c>     rewriteengine on     rewritebase /     rewriterule ^index\.php$ - [l]     rewritecond %{request_filename} !-f     rewritecond %{request_filename} !-d     rewriterule . /index.php [l] </ifmodule> 

this modification works

<ifmodule mod_rewrite.c>    rewriteengine on     rewritebase /blog     rewriterule ^index\.php$ - [l]     rewritecond %{request_filename} !-f     rewritecond %{request_filename} !-d     rewriterule    (.*) index.php [l] </ifmodule> 

try use "wp migrate db" plugin - create data base dump , replace old url's new ones.


Comments