Advertisement
asanchez75

Drupal/.htaccess

Apr 2nd, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. https://www.drupal.org/node/47092#comment-1194271
  2. https://www.brontobytes.com/knowledgebase/202/htaccess-URL-Masking-Examples.html
  3.  
  4. To access the files in the directory:
  5. add a .htaccess file to that directory containing Options All
  6.  
  7. To make simple .htaccess password protection work:
  8. e.g. for something like this
  9.  
  10. AuthType Basic
  11. AuthName "Files for my friends"
  12. AuthUserFile "/home/mysite/.htpasswds/passwd"
  13. require valid-user
  14. edit the drupal-web-root/.htaccess file (eg. public_html/.htaccess) and add a Rewrite Condition
  15. i.e. Find...
  16.  
  17. # Rewrite current-style URLs of the form 'index.php?q=x'.
  18. RewriteCond %{REQUEST_FILENAME} !-f
  19. RewriteCond %{REQUEST_FILENAME} !-d
  20. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  21. and add RewriteCond %{THE_REQUEST} !/path-to-directory/.* before the ReriteRule
  22.  
  23. to get...
  24.  
  25. # Rewrite current-style URLs of the form 'index.php?q=x'.
  26. RewriteCond %{REQUEST_FILENAME} !-f
  27. RewriteCond %{REQUEST_FILENAME} !-d
  28. RewriteCond %{THE_REQUEST} !/path-to-directory/.*
  29. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement