Exclude individual files from being rewritten - .htaccess

Discussion in 'Apache' started by datadugout, Mar 21, 2009.

  1. #1
    Hey all,

    Looking for a little help, hopefully this is pretty straightforward for someone with a little .htaccess experience. Basically I have a Wordpress blog that I just moved from the webroot (/) to /blog. Pretty much everything is working fine, I updated the images path, etc, in the database.. all is working well.

    Since the site has about 120 pages indexed in Google, I put a 301 redirect in my .htaccess to preserve my rankings. Here is how the .htaccess looks right now:

    RewriteEngine On
    rewriteCond %{REQUEST_URI} !^/free-marriage-help/
    rewriteCond %{REQUEST_URI} !^/free-marriage-help

    RewriteBase /
    RewriteRule ^(.*)$ http://www.keepingyourmarriage.com/blog/$1 [L,R=301]

    I'm fairly familiar with webhosts, Wordpress, etc, but definitely not familiar with .htaccess. What I did above was basically exclude the /free-marriage-help directory from being redirected. And then redirected everything else that was off the root to /blog.

    But what I also want to do is exclude certain individual filenames in the webroot. I'm not sure of the full list of filenames this will be, but at least "index.php", and possibly others.

    Can someone advise on what I should add to my .htaccess to exclude the filenames in the webroot that I specify?

    Really grateful for your help -

    Regards,

    - Dave
     
    datadugout, Mar 21, 2009 IP
  2. xd2

    xd2 Peon

    Messages:
    694
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just add them all to your conditions the way you have with the free-mariage-help one.
     
    xd2, Mar 22, 2009 IP