Drupal.htaccess用于启用干净的url';s

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Drupal.htaccess用于启用干净的url';s相关的知识,希望对你有一定的参考价值。

  1. # Various rewrite rules.
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine on
  4.  
  5. # If your site can be accessed both with and without the 'www.' prefix, you
  6. # can use one of the following settings to redirect users to your preferred
  7. # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  8. #
  9. # To redirect all users to access the site WITH the 'www.' prefix,
  10. # (http://example.com/... will be redirected to http://www.example.com/...)
  11. # adapt and uncomment the following:
  12. # RewriteCond %{HTTP_HOST} ^example.com$ [NC]
  13. # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  14. #
  15. # To redirect all users to access the site WITHOUT the 'www.' prefix,
  16. # (http://www.example.com/... will be redirected to http://example.com/...)
  17. # uncomment and adapt the following:
  18. # RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
  19. # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
  20.  
  21. # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  22. # VirtualDocumentRoot and the rewrite rules are not working properly.
  23. # For example if your site is at http://example.com/drupal uncomment and
  24. # modify the following line:
  25. # RewriteBase /drupal
  26. #
  27. # If your site is running in a VirtualDocumentRoot at http://example.com/,
  28. # uncomment the following line:
  29. # RewriteBase /
  30.  
  31. # Rewrite URLs of the form 'index.php?q=x'.
  32. RewriteCond %{REQUEST_FILENAME} !-f
  33. RewriteCond %{REQUEST_FILENAME} !-d
  34. RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  35. </IfModule>

以上是关于Drupal.htaccess用于启用干净的url';s的主要内容,如果未能解决你的问题,请参考以下文章

htaccess 用于 apache 未读取的干净 url?

启用干净的 URL (Drupal 7)

在 Yii2 中启用干净的 URL

Drupal htaccess phpu值(增加限制)

用于获取干净 URL 的 NGINX 重写规则

PrettyFaces 和 h:link 结果标签不会重定向到干净的 URL