Want to delete the about:blank
from a URL www.example.com/camera/about:blank
. How can I do this with .htaccess
? I tried RewriteCond %{QUERY_STRING} (about:blank) [NC]
but it didn't work.
Asked
Active
Viewed 83 times
1 Answers
0
delete the
about:blank
from a URLwww.example.com/camera/about:blank
In the URL as posted, about:blank
is part of the URL-path, not the query string, so you can match this as-is in the RewriteRule
pattern. For example:
RewriteEngine On
RewriteRule ^(camera/)about:blank$ /$1 [R=302,L]
The $1
backreference simply saves repetition. This contains the "camera/" part of the URL-path, as captured from the requested URL-path.
If this is intended to be permanent then change to a 301 only once you have confirmed that it works OK - to avoid potential caching issues.

MrWhite
- 12,647
- 4
- 29
- 41
-
Thank you very much! I will try it! :-) – Karl Feb 15 '21 at 15:58
-
How did you get on with this? – MrWhite Feb 20 '21 at 18:24