I'm asking in this forum because there are some specific Drupal 8 rules that might need to be applied.

I am looking for the correct way to add .htaccess rules that allow for:

domain.com/specific/ to be domain.com/script.php

I would first have to allow the request for /specific/ to happen without Drupal taking it, and then point /specific/ to /script.php

The closest I have been able to get is:

  RewriteCond %{REQUEST_URI} "/specific/"
  RewriteRule (.*) $1 [L]

  RewriteRule ^specific(/|$) script.php [L]

This is not ideal though, as the user ends up at: domain.com/script.php

  • What do you have so far? Does it work? Or doesn't it? – leymannx Apr 30 at 14:48
  • @leymannx I've updated wiht as close as I've been able to figure out so far. – lms_forever Apr 30 at 14:53
  • Use /specific/index.php for your script file, no rewrite rule should be needed for this to be accessible with plain /specific – Hudri Apr 30 at 15:04
  • @hudri for various reasons, script.php needs to stay in the root level. – lms_forever Apr 30 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.