Results 1 to 4 of 4

Thread: .htaccess help

Hybrid View

  1. #1

    .htaccess help


    I am wondering what I might be doing wrong. Do I have a wrong code in here or a space in the wrong place

    Question 1 Try going to my site with the www. works OK without but not with.

    Question 2 I want the .gif to hotlink for my banner exchange but it does not show up.

    Question 3 Anything that you would add or change? And Why?

    Here is what I am using.

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^britneyspearsfans\.info
    RewriteRule (.*)$1 [R=301,L]
    # disable directory browsing
    Options All -Indexes
    # protect the htaccess file
    <files .htaccess>
    order allow,deny
    deny from all
    # disable the server signature
    ServerSignature Off
    # protect php.ini
    <files *.ini>
    order allow,deny
    deny from all
    RewriteEngine on
    RewriteRule ^MSOffice/(.*)$ / [R=301]
    RewriteRule ^_vti_(.*)$ / [R=301]
    RewriteRule ^(.*)index.rdf$ /rss.php [R=301]
    ### no hotlinking
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?britneyspearsfans\.info/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpe?g|JPG|bmp|png|tiff)$ - [F,NC]
    Redirect permanent /robot.txt
    Redirect permanent /robotsxx.txt
    Redirect permanent /xxx_robots.txt
    Thanks in Advance

    Buttterflies Forever

    Current Celebrity Gossip Movies & More TV Site
    Find out how I'm able to get up to 420 backlinks for month, by spending 30 seconds per day...all for FREE! - Click Here

  2. #2

    You've got a small error here in your httaccess :

    RewriteCond %{HTTP_HOST} !^britneyspearsfans\.info
    RewriteRule (.*)$1 [R=301,L]
    What that is doing is if the host is not exactly '' it'll redirect to the www, however, when trying to visit the www version of your site, you see that it doesn't work because your condition is like "hey this doesn't match the htaccess ReWriteCond, I'll redirect it" and then it gets stuck in a loop doing that over and over again.

    If you only want it available on the www you'll need to change that condition to look like so :

    RewriteCond %{HTTP_HOST} !^www\.britneyspearsfans\.info
    RewriteRule (.*)$1 [R=301,L]
    For your other question, I'm not sure what you're asking about what gif?

  3. #3

    What I would like it to do is go to the site if they type www. or not. Also want the link juice to be combined. Some links I placed with the www and some I placed without.

    My other site has this code on it. Is this what I need?
    I know change the url name.

    RewriteCond %{HTTP_HOST} ^$ [OR]
    RewriteCond %{HTTP_HOST} ^$
    RewriteRule ^(.*)$ "http\:\/\/freewomensblogs\.com\/" [R=301,L]
    As for the the .gif question do I have the hotlink code right?

    What I want it to say is The only thing that anyone could hotlink off the site is .gif files
    All the rest would be shut off.

    Also what do thes codes do?

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    Just want to cover all my bases.


    Current Celebrity Gossip Movies & More TV Site
    Find out how I'm able to get up to 420 backlinks for month, by spending 30 seconds per day...all for FREE! - Click Here

  4. #4

    You can use either this :

    RewriteCond %{HTTP_HOST} !^www\.britneyspearsfans\.info
    RewriteRule (.*)$1 [R=301,L]
    or this :

    RewriteCond %{HTTP_HOST} !^britneyspearsfans\.info
    RewriteRule (.*)$1 [R=301,L]
    Either one will work. Both will accept connections from www and nonwww. The only differences being that the link juice will be combined to go to the format you choose.

    Ah okay I get what you were asking, your "no hotlinking" code in the first post appears to be okay except for the last line should be [NC,F] instead of the opposite. Though you could take out the 'JPG' entry since the 'jpe?g' will cover that.

    As for those other things, sorry I'm not sure what they are, though some look like they might belong to wordpress? I dunno.

Similar Threads

  1. .htaccess Problem
    By in forum Managing
    Replies: 1
    Last Post: 12 April, 2010, 20:11 PM
  2. How To Update .htaccess
    By garfish in forum Wordpress
    Replies: 7
    Last Post: 9 January, 2010, 12:48 PM
  3. .htaccess / redirect to 'www.'
    By Snak3 in forum On-Site SEO
    Replies: 12
    Last Post: 30 December, 2009, 20:13 PM
  4. .htaccess
    By dodolls in forum Managing
    Replies: 6
    Last Post: 15 November, 2009, 07:58 AM
  5. help with htaccess redirection
    By MeetHere in forum Programming
    Replies: 10
    Last Post: 18 October, 2009, 17:01 PM

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts