RedirectMatch as in e.g.
RedirectMatch 404 /\.
does the trick, it prohibits access to all files or directories starting with a dot, giving a “404 Not Found” error.
From the Apache manual: “The Redirect[Match] directive maps an old URL into a new one by asking the client to refetch the resource at the new location.” By default, Redirect sends a 302 return code, but it can also return other status codes as shown above.
Related Contents:
- If you use HTTPS will your URL params will be safe from sniffing? [duplicate]
- Tips for debugging .htaccess rewrite rules
- What is the best way to implement “remember me” for a website? [closed]
- How to redirect all HTTP requests to HTTPS
- Error message “Forbidden You don’t have permission to access / on this server” [closed]
- Difference between Hashing a Password and Encrypting it
- How to debug Apache mod_rewrite
- htaccess remove index.php from url
- JWT (JSON Web Token) automatic prolongation of expiration
- How do I create a self-signed certificate for code signing on Windows?
- What is token-based authentication?
- XMLHttpRequest cannot load file. Cross origin requests are only supported for HTTP
- The necessity of hiding the salt for a hash
- Will web browsers cache content over https
- Is it possible to reverse a SHA-1?
- Pretty URLs with .htaccess
- Is it safe to enable CORS to * for a public and readonly webservice?
- How to debug .htaccess RewriteRule not working
- Where do you store your salt strings?
- How to force https on elastic beanstalk?
- Password hashing, salt and storage of hashed values
- How can I match query string variables with mod_rewrite?
- Yii2 htaccess – How to hide frontend/web and backend/web COMPLETELY
- SPA best practices for authentication and session management
- Why is using a Non-Random IV with CBC Mode a vulnerability?
- What algorithm should I use to hash passwords into my database? [duplicate]
- Differences Between Rijndael and AES
- How are software license keys generated?
- What is happening when I have two CSP (Content Security Policies) policies – header & meta?
- How to redirect URLs based on query string?
- 301 Redirect to replace all spaces to hyphens
- How do I store and retrieve credentials from the Windows Vault credential manager?
- Why not use MD5 for password hashing?
- WAMP 403 Forbidden message on Windows 7
- Are Google Cloud Functions protected from DDoS attacks?
- CSS, JS and images do not display with pretty url
- Docker and securing passwords
- OAuth2 and Google API: access token expiration time?
- Send mail via Gmail with PowerShell V2’s Send-MailMessage
- IIS7, web.config to allow only static file handler in directory /uploads of website
- How will a server become vulnerable with chmod 777?
- Mod_Rewrite unexpected behavior L flag
- Secure Google Cloud Functions http trigger with auth
- What is a retpoline and how does it work?
- Is it worth encrypting email addresses in the database?
- Apache rewrite based on subdomain
- apache HTTP:X-Forwarded-Proto in .htaccess is causing redirect loop in dev environment
- rewrite rules for apache 2 to use with angular js
- Difference between CSRF and X-CSRF-Token
- htaccess redirect index.php to root (including subdomains)