Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 989 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Other Programming Languages :

Mod rewrite problem

Thread title: Mod rewrite problem
Closed Thread    
    Thread tools Search this thread Display Modes  
12-01-2007, 08:41 PM
#1
resolva is offline resolva
Status: I love this place
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 721
iTrader: 4 / 100%
 

resolva is on a distinguished road

Send a message via MSN to resolva

  Old  Mod rewrite problem

Hello all, I currently have a mod-rewrite problem: If you look at the site http://www.funnycabin.com I have the following mod-rewrite for it but it doesnt seem to work:

########## Error Documents
ErrorDocument 400 /error.php?c=400
ErrorDocument 401 /error.php?c=401
ErrorDocument 403 /error.php?c=403
ErrorDocument 404 /error.php?c=404
ErrorDocument 500 /error.php?c=500
ErrorDocument 502 /error.php?c=502
ErrorDocument 503 /error.php?c=503


########## Rewrite rules to block out some common exploits
RewriteEngine on
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]

# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]

# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]

# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})

# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]


########## Rewrite rules to make nice URLS
RewriteRule ^view/$/ /index.php?image=$1 [L]

RewriteRule ^rate/$/$ /rate.php?image=$1&rating=$2 [L]

RewriteRule ^leave/$ /leaving.php?site=$1 [L]

Anyone know what could be the problem?

Thank you very much

12-01-2007, 09:08 PM
#2
Andrew R is offline Andrew R
Status: Request a custom title
Join date: Dec 2005
Location: Arizona
Expertise:
Software:
 
Posts: 5,200
iTrader: 17 / 95%
 

Andrew R is on a distinguished road

  Old

Code:
RewriteRule ^view/$/ /index.php?image=$1 [L]

RewriteRule ^rate/$/$ /rate.php?image=$1&rating=$2 [L]

RewriteRule ^leave/$ /leaving.php?site=$1 [L]
Should be:
Code:
RewriteRule ^view/(.*)/$ /index.php?image=$1 [L]

RewriteRule ^rate/(.*)/(.*)$ /rate.php?image=$1&rating=$2 [L]

RewriteRule ^leave/(.*)$ /leaving.php?site=$1 [L]
Or at least, that should work, in theory. Also, once it works, you need to change all your links to link to the URL you want (i.e. link to http://www.youriste.com/view/1/)

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed