Results 1 to 4 of 4

Thread: .htaccess help

  1. #1
    Sami4u's Avatar
    Sami4u is offline Butterflies Forever
    Join Date
    Sep 2009
    Location
    USA
    Posts
    1,407
    Thanks
    670
    Thanked 292 Times in 220 Posts

    .htaccess help

    Hi,

    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.

    Code:
     
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^britneyspearsfans\.info
    RewriteRule (.*) http://www.britneyspearsfans.info/$1 [R=301,L]
    # disable directory browsing
    Options All -Indexes
    # protect the htaccess file
    <files .htaccess>
    order allow,deny
    deny from all
    </files>
    # disable the server signature
    ServerSignature Off
    # protect php.ini
    <files *.ini>
    order allow,deny
    deny from all
    </files>
    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 http://britneyspearsfans.info/robots.txt
    Redirect permanent /robotsxx.txt http://britneyspearsfans.info/robots.txt
    Redirect permanent /xxx_robots.txt http://britneyspearsfans.info/robots.txt
    Thanks in Advance

    Buttterflies Forever

    Sami
    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
    dtkguy's Avatar
    dtkguy is offline Still Learnin'
    Join Date
    Dec 2008
    Posts
    391
    Thanks
    7
    Thanked 164 Times in 108 Posts
    Hey,

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

    Code:
    RewriteCond %{HTTP_HOST} !^britneyspearsfans\.info
    RewriteRule (.*) http://www.britneyspearsfans.info/$1 [R=301,L]
    What that is doing is if the host is not exactly 'britneyspearsfans.info' 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 :

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

  3. Thanked by:

    Sami4u (13 September, 2009), Will.Spencer (24 September, 2009)

  4. #3
    Sami4u's Avatar
    Sami4u is offline Butterflies Forever
    Join Date
    Sep 2009
    Location
    USA
    Posts
    1,407
    Thanks
    670
    Thanked 292 Times in 220 Posts
    Hi,

    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.

    Code:
     
    RewriteCond %{HTTP_HOST} ^freewomensblogs.info$ [OR]
    RewriteCond %{HTTP_HOST} ^www.freewomensblogs.info$
    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?

    Code:
     
    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
    </Files>
    </IfModule>
    Just want to cover all my bases.

    Thanks

    Sami
    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

  5. #4
    dtkguy's Avatar
    dtkguy is offline Still Learnin'
    Join Date
    Dec 2008
    Posts
    391
    Thanks
    7
    Thanked 164 Times in 108 Posts
    Hey,

    You can use either this :

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

    Code:
    RewriteCond %{HTTP_HOST} !^britneyspearsfans\.info
    RewriteRule (.*) http://britneyspearsfans.info/$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.

  6. Thanked by:

    bogart (15 September, 2009), Sami4u (14 September, 2009), Will.Spencer (24 September, 2009)

Similar Threads

  1. .htaccess Problem
    By ProxySites.ca 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, 11:48 AM
  3. .htaccess / redirect to 'www.'
    By Snak3 in forum On-Site SEO
    Replies: 12
    Last Post: 30 December, 2009, 19:13 PM
  4. .htaccess
    By dodolls in forum Managing
    Replies: 6
    Last Post: 15 November, 2009, 06: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

Bookmarks

Posting Permissions

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