htaccess – WP moved from subdomain to subfolder with EE in root
-
I had a WP install running in a subdomain (blog.domain.com) but now I’ve been asked to move it to a subfolder of the primary domain (domain.com/blog) which is running Expression Engine (EE) in the root.
I’ve copied all the files and updated the URLs in the database.
The WP site shows the homepage just fine and I can view the wp-admin area too but all content pages from the WP site are showing the homepage from the root EE site keeping the WP permalinks in the address bar.
I’ve tried many different ways to write the RewriteCond rule in the root .htaccess and have updated the WP rules to include the new base path but always the same result and I’m not sure where the problem is.
Here’s the relevant part of the root EE .htaccess which now has a rule to ignore the subfolder (along with an alternative attempt which also didn’t work):
RewriteEngine On # make EE ignore blog directory requests #RewriteCond %{REQUEST_URI} ^blog.* #RewriteRule ^(.*)$ /blog/index.php?/$1 [L] RewriteCond %{REQUEST_URI} ^/blog/(.*)$ RewriteCond $1 !\.(gif|jpe?g|png)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L]
Here’s the new WP subfolder .htaccess:
RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L]
Can anyone shed some light on what I’m doing wrong here?!
- The topic ‘htaccess – WP moved from subdomain to subfolder with EE in root’ is closed to new replies.