Apache Post name likes break after site migration to new domain
I moved my site from Bluehost, where post-name symlinks worked. I moved to the above. rewrite is enabled.
I exported the database, zipped and Dled the wp folder.
I changed the relevant lines in config.php. I changed the site URL in options in the database. I did a search and replace to change to the correct site URL.
Post name URLS did not work. I changed to plain, they did work. I changed back to post name, they don’t work. I changed back to plain and then deleted the .htaccess file, and changed back to post name.
Wordpress generated this .htacess:
type or paste code her# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
# BEGIN Math Captcha
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post.php*
RewriteCond %{HTTP_REFERER} !.*www.meuslocus.net.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
</IfModule>
# END Math Captcha
RewriteCond %{REQUEST_FILENAME} -s
RewriteCond %{HTTP_USER_AGENT} !facebookexternalhit/[0-9]
RewriteCond %{HTTP_USER_AGENT} !Twitterbot/[0-9]
RewriteCond %{HTTP_USER_AGENT} !Googlebot/[0-9]
RewriteRule wp-content/uploads/wp-import-export-lite(\/[A-Za-z0-9_@.\/&+-]+)+\.([A-Za-z0-9_@.\/&+-]+)$ [L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /ml/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ml/index.php [L]
</IfModule>
# END WordPresse
The links don’t work.
I turned off all plugins, switched to plain, deleted the .htaccess and changed back to postname.Wordpress generated this .htaccess:
type or paste# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /ml/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ml/index.php [L]
</IfModule>
# END WordPress code here
Links don’t work.
I only had templates in /etc/apache2/vhosts.d. I put httpd-vhosts.conf in that directory and put his into it:
type or past<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>e code here
I restarted apache2 and was not able to log in. I renamed the file to httpd-vhosts.conf.new and restarted apache2 and could again log in.
In case it isn’t obvious, I have no knowledge of vhosts or vhost files.