.htaccess URL rewriting superceeded by WP (4 posts)

  1. bmcent1
    Posted 5 years ago #

    Hello -
    Long ago I registered http://www.bscottphotography.com and used that for my small business website. Later, I registered the short version http://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 http://www.bscottphoto.com/
    RewriteCond %{HTTP_HOST} ^([^.:]+\.)*bscottphotography\.com\.?(:[0-9]*)?$ [NC]
    RewriteRule ^(.*)$ http://www.bscottphoto.com/$1 [R=301,L]

    This works for any directory except /blog where WP lives.

    For example, if you visit: http://www.bscottphotography.com/commercial-photography/ it will redirect you to http://www.bscottphoto.com/commercial-photography/

    If you visit http://www.bscottphotography.com/blog/ it does not get rewritten. Instead, it serves up the same page as http://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 -- http://www.bscottphotography.com -- and that is the one I used when setting up WP and testing it out. After everything worked, I transferred http://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: http://www.bscottphoto.com/blog

    Is there something in WordPress that is rewriting or accepting the http://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?


  2. bmcent1
    Posted 5 years ago #

    Hmm... this post seemed "locked" yesterday when I tried to add something. Trying again...

  3. bmcent1
    Posted 5 years ago #

    Maybe that was too much background :)

    Q: Is there a way to see what rewriting rules are in effect in WordPress?

  4. bmcent1
    Posted 5 years ago #

    Is there a better forum to post this in?

Topic Closed

This topic has been closed to new replies.

About this Topic