Skip to main content

Block directory scans

Directions

To achieve the desired redirection, you need to incorporate Apache rewrite rules into your .htaccess file. For instance, the provided example will redirect any requests attempting to access files with names that begin with "phpMyAdmin" to index.php.

Sample Apache Rewrite Rule

RewriteRule ^/phpMyAdmin.*$ /index.php

Some Regular Expression Tips

  • ^ signifies the start of the filename.
  • . represents any character except for newlines.
  • * indicates one or more occurrences of the preceding character.
  • $ denotes the end of the line.