Url rewrite not working after changing site url
Since we want to launch the website, I had to change the url of devdom.com to liveom.com , the start page loaded , but I cannot load other pages unless I deactivate the pretty url / permalink settings! It worked fine before I changed the site url. If I use any permalink setting, the server gives me a 404 not found message.
What I've done:
- changing property
DOMAIN_CURRENT_SITE
in wp-config.php - change
WP_HOME
andWP_SITEURL
using wp-config.php (i checked it in db, values were updated properly) - Run search db replace script (see https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ ) which worked fine
content of my .htaccess:
# WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# Media Library
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
# Disallow access to important files
<FilesMatch "(^\.|wp-config\.php|xmlrpc\.php|(?<!robots)\.txt|(liesmich|readme)\.*)">
Order deny,allow
Deny from all
</FilesMatch>
# Prevent Directory Listings
Options -Indexes
I am using apache on ubuntu server, wordpress version 4.0.
Hope you guys can help me, would appreciate it.
Thank,
Ronin
****** UPDATE ******
- I'm not sure if this matters, but this is a network / multisite installation .
- also, I set the directive
ServerName
to www.livedom.com in vshost / etc / apache2 / sites-available / www.devdom.com.conf file
source to share
Yes, I did it! There are various other pages in this same field due to the fact that vhosts allows all of these pages to run.
Now what I came up with:
- copied the old vhost config file to the new one:
cp devdom.com.conf livedom.com.conf
- new vhost registered:
a2ensite livedom.com.conf
- unregistred the old vhost, removed the old vhost config file:
a2dissite devdom.com.conf
rm devdom.com.conf
- restarted the rewrite module:
a2dismod rewrite
a2enmod rewrite
after each step I restarted the apache service: service apache2 restart
which helped :)
source to share