Need mod rewrite help

Discussion in 'Programming' started by puurlucky, Oct 15, 2008.

  1. #1
    Here is my problem.
    I have a gaming website buth another website is leeching some games from my website( using my bandwitch).
    So now i want it to block all websites exept mine..
    So how can i do it ?
    I now its possible with mod rewrite buth i couldent do it right.

    These codes are already in the .htaccess file so i cant change them otherwise the website dont work.


    RewriteEngine on
    RewriteRule ^play-([0-9]+) play.php?id=$1 [L]
    RewriteRule ^full-([0-9]+) full.php?id=$1 [L]
    RewriteRule ^cat-([0-9]+)?-p([0-9]+) games.php?cat=$1&page=$2 [L]
    RewriteRule ^profile-(.*)\.html$ page.php?page=viewprofile&user=$1 [L]
    RewriteRule ^page-(.*)\.html$ page.php?page=$1 [L]
    RewriteRule ^rss-(.*)\.xml$ xml.php?action=$1 [L]
    RewriteRule ^antispamnumber.jpg antispamnumber.php [L]
    Options -Indexes


    And i found this code to protect it


    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://themebot.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://themebot.com$ [NC]
    RewriteRule .*\.(.*)$ http://themebot.com/ [R,NC]



    So i did this


    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://mywebsite.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://mywebsite.com$ [NC]
    RewriteRule .*\.(.*)$ http://mywebsite.com/ [R,NC]
    RewriteRule ^play-([0-9]+) play.php?id=$1 [L]
    RewriteRule ^full-([0-9]+) full.php?id=$1 [L]
    RewriteRule ^cat-([0-9]+)?-p([0-9]+) games.php?cat=$1&page=$2 [L]
    RewriteRule ^profile-(.*)\.html$ page.php?page=viewprofile&user=$1 [L]
    RewriteRule ^page-(.*)\.html$ page.php?page=$1 [L]
    RewriteRule ^rss-(.*)\.xml$ xml.php?action=$1 [L]
    RewriteRule ^antispamnumber.jpg antispamnumber.php [L]
    Options -Indexes


    Buth the website isent loading when i upload it ?
    And i also tryed to protect it with the hotlink protection from cpanel buth than it gives this error
    Code:
    Apache detected an error in the Rewrite config.
    Syntax error on line 9 of /home/onlinega/public_html/.htaccess.r4_XDEBEQ3LrPvnVSuOUH3PEOmzW9qje:
    Illegal option IndexesRewriteCond
    Please try again.



    Anyone who can fix this ?
     
    puurlucky, Oct 15, 2008 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    Add options at the top instead at the end? hope this works!
     
    EricBruggema, Oct 15, 2008 IP