Apache Rewrite Rule

Alles, was den Apache betrifft, kann hier besprochen werden.

Apache Rewrite Rule

Postby jonny002 » 18. September 2015 11:30


I am trying to create a rewrite rule so that if a user puts in a certain URI into their browser it gets redirected to a 400 error page on the server and also gives a 400 error in the log, I have tried the following but have had no luck. Any help would be very much appreciated:

RewriteCond %{QUERY_STRING} ?uri=nm:eek:id:
RewriteRule /error/400.html [L=400]
Posts: 1
Joined: 18. September 2015 11:26
Operating System: Linux

Re: Apache Rewrite Rule

Postby Nobbie » 18. September 2015 17:14

Your RewriteRule is invalid, there is missing one parameter (either the so called "Pattern" or the so called "Substitution". This is the syntax of the RewriteRule:

Code: Select all
RewriteRule Pattern Substitution [flags]

See http://httpd.apache.org/docs/current/mo ... ewriterule
Posts: 9331
Joined: 09. March 2008 13:04

Return to Apache

Who is online

Users browsing this forum: No registered users and 4 guests