Moved Blog Now Rewriting Broken Inbound Permalinks in .htaccess File
-
I moved my blog from the root to a the directory /blog and created the .htaccess code below to redirect the broken inbound permalinks. Now I am moving it to a subdomain blog.theenchantedimage.com and I have two problems:
1) The code at the bottom works for my directory of my root /blog
with the broken links but it won’t work on the subdomain
blog.theenchantedimage.com
2) The code below is also redirecting anyone that goes to my root
to the blog and I want to make sure in the future that won’t
happen as I will be hosting a website on the root.RewriteEngine on RewriteCond %{HTTP_HOST} ^theenchantedimage\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.theenchantedimage\.com$ [NC] RewriteCond %{REQUEST_URI} !^/\blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /\blog/$1 RewriteCond %{HTTP_HOST} ^(www.)theenchantedimage.com$ [NC] RewriteRule ^(/)?$ blog/index.php [L]
I was thinking that I needed to use the
<IfModule mod_rewrite.c>
to avoid searches going to the website I will be hosting on the root directory but I haven’t been able to figure this out. Any help would be greatly appreciated as I am have been pulling my hair out trying to figure this one out and it just doesn’t matter how many articles I read I can’t get it to work.Thanks In Advanced!
- The topic ‘Moved Blog Now Rewriting Broken Inbound Permalinks in .htaccess File’ is closed to new replies.