skip to Main Content

Why does the following file does not exist condition not work in htaccess? – Apache

Don't know why the following rewrite rules do not work. The file-not-exist condition always triggers even though the file article/1.html file does exist. The requested URL is: https://exampledomain.com/test-a-1.html RewriteCond %{REQUEST_FILENAME} ^(.*)-a-([0123456789_]*).html$ RewriteCond %{DOCUMENT_ROOT}/article/%2.html !-f [NC,OR] RewriteCond %{QUERY_STRING} !^$ RewriteRule ^(.*)-a-([0123456789_]*).html$…

VIEW QUESTION

Handle one query parameter specifically – Apache

I need to handle one query parameter specifically. The url can look like the following: https://example.com/?app=egov&map=1337 https://example.com/?app=egov&map=1337&showoptions=true https://example.com/?app=egov&map=1337&showoptions=true&anotherparam=helloWorld The redirect should point to https://example.com/contextName/resources/apps/egov/index.html?map=1337 https://example.com/contextName/resources/apps/egov/index.html?map=1337&showoptions=true https://example.com/contextName/resources/apps/egov/index.html?map=1337&anotherparam=helloWorld As you can see, the app-Parameter needs to be used as an URL-part; the…

VIEW QUESTION

Intermittent RewriteRule – Apache

This is my rewrite rule in .htaccess: RewriteRule ^quiz/([A-Za-z0-9-]+)/([0-9-]+)/?$ quiz/index.php?inv=$1&d=$2 [NC,L] It works perfectly fine for these URLs, which have a mix of cases, with and without hyphens, and all with a date for the final segment: http://localhost/quiz/C-PFM/2021-04-30/ http://localhost/quiz/cpf-o/2021-04-30/ http://localhost/quiz/ipa/2021-04-30/…

VIEW QUESTION
Back To Top
Search