Help with 404 in .htaccess please

soa0611

Elite Member
Joined
Apr 20, 2015
Messages
2,790
Reaction score
2,542
Guys, how to set up 404 properly for a certain page?

i do:

RewriteCond %{QUERY_STRING} =myurl
RewriteRule .* - [R=404,L]

but it won't work
where is the mistake?
 
Guys, how to set up 404 properly for a certain page?

i do:

RewriteCond %{QUERY_STRING} =myurl
RewriteRule .* - [R=404,L]

but it won't work
where is the mistake?
Did you check the server configuration to make sure that it is processing the rules in the .htaccess and that modrewrite is enabled?
 
Why are you using string at all?

redirect 301 /missing-page/ /404-page/

Thats it. Works like a charm.

how can i write as a code for .htaccess?
 
Back
Top