Redirect file/request

New to mod_rewrite? This is a good place to start.

Redirect file/request

Postby stanley_loh » Fri Jan 09, 2004 1:24 am

:wink: Do any one know how to redirect a file/request to "forbidden" page? For example, recently I have received a "GET /NULL.ida?...." on my apache log file. I would like to redirect this request to "forbidden" page.
stanley_loh
 
Posts: 3
Joined: Fri Jan 09, 2004 1:19 am

Postby iiinetworks » Sat Jan 10, 2004 3:46 am

You would put a [F] at the end of your RewriteRule directive.

Hth,
Matt
iiinetworks
 
Posts: 8
Joined: Sat Oct 11, 2003 11:53 am

Postby stanley_loh » Sun Jan 11, 2004 5:18 pm

Is that as follow?

RewriteEngine on
RewriteCond %{REQUEST_URI} ^NULL\.*$ [NC]
RewriteRule ^/$ - [F]

Thanks a lot.
stanley_loh
 
Posts: 3
Joined: Fri Jan 09, 2004 1:19 am

Postby iiinetworks » Mon Jan 12, 2004 10:40 am

Code: Select all
RewriteEngine on
RewriteRule ^/NULL\..*$ - [F]
I would think that it would just look like this. Haven't tried it though; maybe I'm missing something.

Hth,
Matt
iiinetworks
 
Posts: 8
Joined: Sat Oct 11, 2003 11:53 am

Postby stanley_loh » Mon Jan 12, 2004 5:08 pm

:) Thanks a lot. Will try out and come back to you again if it's doesn't work.

Best Regards,
Stanley
stanley_loh
 
Posts: 3
Joined: Fri Jan 09, 2004 1:19 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 99 guests

cron