StackOverflow:
Example of mod_dir conflict, exposing rewritten file-path. Use of env var to avoid repetition.
URL masking not working for URLs that omit the trailing slashRedirecting URLs containing one of 50 US state names to the corresponding URL with the state "code" (not in the original URL). Solution uses just a single rule and series of conditions to act as the lookup table for state codes.
How to 301 a URL without a query string to a different URL with a query string / my answerLooking up an "ID" from a
RewriteMap
which is used in two places in the source and target URLs.
Redirect to new URL having looked up new "ID" in RewriteMap which appears in two places in the target URLBiggest misunderstandings of CSS [DELETED 2010!]
https://stackoverflow.com/questions/4038051/the-biggest-misunderstanding-of-how-css-works/4038117#4038117Reordering/canonicalising URL parameters using
.htaccess
How to reorder URL parameters / query string using Apache htaccess?Includes an explanation of when
REQUEST_FILENAME
(Apache server variable) is calculated
Apache RewriteCond %{REQUEST_FILENAME} !-f failing when file exists
DELETED:
- https://stackoverflow.com/questions/20090207/remove-cpanel-login-pages-from-the-google-index (would have been on-topic on Webmasters SE) - Question answered 16-May-2014, closed and deleted on 24-May-2023 (9 years later)
ServerFault:
Potential security vulnerability using "vulnerable" mod_rewrite directives in the server config. [Why CLOSED?] https://serverfault.com/questions/1091045/how-to-prevent-apache-rewriterule-from-accessing-root-path
Negated blocking rule being applied due to a front-controller pattern later in the
.htaccess
file. A relatively common trap. I give 3 solutions. https://serverfault.com/questions/1140684/rewrite-apache-condition-not-preventing-rewrite-from-getting-appliedSearch and replace all occurrences of
-
(hyphen) in a specific URL parameter with+
(encoded space) using just a single redirect in.htaccess
. (Although this should arguably be resolved in the application, not Apache/.htaccess
.
https://serverfault.com/questions/1140610/htaccess-redirects-with-special-characters-on-an-specific-url-not-working
Other/past usernames: w3d / w3dk / penders / MrWhite