0

I want to block some url and return 401 error. This are the url's i want to block. But this is a just pattern.

mysitecom/?p=lancel%20soldes%20amazon%20canada mysitecom/?p=lancel%20soldes%20kartell%20table%20basse mysitecom/?p=prix+sac+la+charmeuse+de+lancel mysitecom/?lancel=bb-prix-wii-fit mysitecom/page/2/?p=lancel%20soldes%20caroll%20rouen 

Maybe first condutions could be

/?p= /?lancel /page/2/?p 

how can i block this type urls with htaccess?

1 Answer 1

1

How about:

RewriteEngine On RewriteCond %{QUERY_STRING} (?:^p=|lancel) RewriteRule ^ - [L,R=401] 

Last line can also be:

 RewriteRule ^ - [L,F] 

for a 403 response

Sign up to request clarification or add additional context in comments.

1 Comment

You are awesome. It works for all url's except this one page/2/?p=lancel%20soldes%20caroll%20rouen

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.