Reputation: 29
I want migrate Website on wordpress from old web hosting to new web hosting.
My new hosting provider allows extra domain (alias) like this
www/domains/domain1.com
www/domains/domain2.com
My root directory on the new hosting:
/
-.htaccess
-session
-tmp
-www/domains/my-domain.com/wordpressfolder
I have problem with error when I used internal web address(myinternaladdress.hosting.com) from my new hosting to test if everthing work before I route my domain to new hosting.
In Wordpress I set wp-config.php WP_HOME,WP_SITEURL,WP_HOME,WP_SITEURL to
"myinternaladdress.hosting.com/www/domains/my-domain.com/"
.htaccess file in www directory:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^domains/
RewriteCond %{REQUEST_URI} !^/domains/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d
RewriteRule (.*) domains/%2/$1 [DPI]
RewriteCond %{REQUEST_URI} !^subdom/
RewriteCond %{REQUEST_URI} !^/subdom/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d
RewriteRule (.*) subdom/%2/$1 [DPI]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^subdom/[^/]+/(.+[^/])$ /$1/ [R]
.htaccess file in Wordpress directory
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
When I go to myinternaladdress.hosting.com/www/domains/my-domain.com/ main page work well but e.g. /my-domain.com/about/ not found.
Upvotes: 0
Views: 356
Reputation:
Go to Settings > Permalinks
in the admin dashboard and save the page settings and that will flush the rewrite rules which should allow your pages to be accessed again.
Upvotes: 0