.htaccess URL rewriting superceeded by WP
-
Hello –
Long ago I registered https://www.bscottphotography.com and used that for my small business website. Later, I registered the short version https://www.bscottphoto.com and began using that as my primary website.I’ve used 301 redirects via .htaccess in the root of the website to try to tell all search engines and capture traffic headed to the longer URL to use the shorter one. It works everywhere except within my /blog directory which runs WordPress 3.0.1. I suspect WordPress is somehow superceeding the .htaccess at the root of my website.
Here is the relevant part of my .htaccess at https://www.bscottphoto.com/
RewriteCond %{HTTP_HOST} ^([^.:]+\.)*bscottphotography\.com\.?(:[0-9]*)?$ [NC]
RewriteRule ^(.*)$ https://www.bscottphoto.com/$1 [R=301,L]This works for any directory except /blog where WP lives.
For example, if you visit: https://www.bscottphotography.com/commercial-photography/ it will redirect you to https://www.bscottphoto.com/commercial-photography/
If you visit https://www.bscottphotography.com/blog/ it does not get rewritten. Instead, it serves up the same page as https://www.bscottphoto.com/blog/
* When I first setup WordPress I was also transitioning from one web host to another. The first domain that I transferred was the longer one — https://www.bscottphotography.com — and that is the one I used when setting up WP and testing it out. After everything worked, I transferred https://www.bscottphoto.com to the new web host and after the xfer went through, I went to settings in WP and changed the WordPress address and and Site Address to: https://www.bscottphoto.com/blog
Is there something in WordPress that is rewriting or accepting the https://www.bscottphotography.com/blog target that supercedes the rewrite at the root of my website?
What can I do to make sure that the longer URL gets a 301 redirect to the shorter URL within the /blog directory as it does for the other directories on the website?
Thanks!!
- The topic ‘.htaccess URL rewriting superceeded by WP’ is closed to new replies.