0

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.

MrWhite
  • 11,643
  • 4
  • 25
  • 40
Karl
  • 9
  • 1

1 Answers1

0

delete the about:blank from a URL www.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
  • 11,643
  • 4
  • 25
  • 40