没有通过清洁的URL测试 -- 7 领域 和 uri 领域 和 multi-sites 领域 drupal 相关 的问题

Not passing the clean URL test


2
vote

问题

中文

我们在Amazon的AWS上有一个多站点安装,它使用Bitnami Drupal Image(AMI-3F21AA56 - 64位,Unbuntu)作为基础。根据该文档,每个站点都在网站文件夹中具有自己的子目录。每个站点都有一个相应的DNS一个指向我们服务器的记录。 Drupal通过 sites.php 文件处理流量,到目前为止工作得很好。

现在我正在尝试实现清洁的URL,并且测试继续失败。我在Web周围的各种建议中使用了重写的.CONF文件中的重写设置,但到目前为止没有任何工作。

mod_rewrite已启用。 我当前的drupal.conf文件是:

  # App url moved to root DocumentRoot "/home/bitnami/apps/drupal/htdocs" #Alias /drupal/ "/opt/bitnami/apps/drupal/htdocs/" #Alias /drupal "/opt/bitnami/apps/drupal/htdocs"  <Directory "/home/bitnami/apps/drupal/htdocs">     Options +MultiViews     AllowOverride All     <IfVersion < 2.3 >     Order allow,deny     Allow from all     </IfVersion>     <IfVersion >= 2.3>     Require all granted     </IfVersion> </Directory>  # Uncomment the following lines to see your application in the root # of your URL. This is not compatible with more than one application. # RewriteEngine On # RewriteRule ^/$ /drupal/ [PT]   

htaccess.conf(我认为这是Bitnami为Drupal 7拥有全局.htaccess的方式,包括多站点配置)如下所示(为长度道歉):

  <Directory "/opt/bitnami/apps/drupal/htdocs/"> # # Apache/PHP/Drupal settings: #  # Protect files and directories from prying eyes. <FilesMatch ".(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(.php)?|xtmpl)$|^(..*|Entries.*|Repository|Root|Tag|Template)$">   Order allow,deny </FilesMatch>  # Don't show directory listings for URLs which map to a directory. Options -Indexes  # Follow symbolic links in this directory. # Options +FollowSymLinks  # Make Drupal handle any 404 errors. ErrorDocument 404 /index.php  # Set the default handler. DirectoryIndex index.php index.html index.htm  # Override PHP settings that cannot be changed at runtime. See # sites/default/default.settings.php and drupal_environment_initialize() in # includes/bootstrap.inc for settings that can be changed at runtime.  php_value memory_limit 64M  # PHP 5, Apache 1 and 2. <IfModule mod_php5.c>   php_flag magic_quotes_gpc                 off   php_flag magic_quotes_sybase              off   php_flag register_globals                 off   php_flag session.auto_start               off   php_value mbstring.http_input             pass   php_value mbstring.http_output            pass   php_flag mbstring.encoding_translation    off </IfModule>  # Requires mod_expires to be enabled. <IfModule mod_expires.c>   # Enable expirations.   ExpiresActive On    # Cache all files for 2 weeks after access (A).   ExpiresDefault A1209600    <FilesMatch .php$>     # Do not allow PHP scripts to be cached unless they explicitly send cache     # headers themselves. Otherwise all scripts would have to overwrite the     # headers set by mod_expires if they want another caching behavior. This may     # fail if an error occurs early in the bootstrap process, and it may cause     # problems if a non-Drupal PHP file is installed in a subdirectory.     ExpiresActive Off   </FilesMatch> </IfModule>  # Various rewrite rules. <IfModule mod_rewrite.c>   RewriteEngine on    # Block access to "hidden" directories whose names begin with a period. This   # includes directories used by version control systems such as Subversion or   # Git to store control files. Files whose names begin with a period, as well   # as the control files used by CVS, are protected by the FilesMatch directive   # above.   #   # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is   # not possible to block access to entire directories from .htaccess, because   # <DirectoryMatch> is not allowed here.   #   # If you do not have mod_rewrite installed, you should remove these   # directories from your webroot or otherwise protect them from being   # downloaded.   RewriteRule "(^|/)." - [F]    # If your site can be accessed both with and without the 'www.' prefix, you   # can use one of the following settings to redirect users to your preferred   # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:   #   # To redirect all users to access the site WITH the 'www.' prefix,   # (http://example.com/... will be redirected to http://www.example.com/...)   # uncomment the following:   # RewriteCond %{HTTP_HOST} !^www. [NC]   # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]   #   # To redirect all users to access the site WITHOUT the 'www.' prefix,   # (http://www.example.com/... will be redirected to http://example.com/...)   # uncomment the following:   # RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]   # RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]    # Modify the RewriteBase if you are using Drupal in a subdirectory or in a   # VirtualDocumentRoot and the rewrite rules are not working properly.   # For example if your site is at http://example.com/drupal uncomment and   # modify the following line:   RewriteBase /drupal   #   # If your site is running in a VirtualDocumentRoot at http://example.com/,   # uncomment the following line:   RewriteBase /    # Pass all requests not referring directly to files in the filesystem to   # index.php. Clean URLs are handled in drupal_environment_initialize().   RewriteCond %{REQUEST_FILENAME} !-f   RewriteCond %{REQUEST_FILENAME} !-d   RewriteCond %{REQUEST_URI} !=/favicon.ico   RewriteRule ^ index.php [L]    # Rules to correctly serve gzip compressed CSS and JS files.   # Requires both mod_rewrite and mod_headers to be enabled.   <IfModule mod_headers.c>     # Serve gzip compressed CSS files if they exist and the client accepts gzip.     RewriteCond %{HTTP:Accept-encoding} gzip     RewriteCond %{REQUEST_FILENAME}.gz -s     RewriteRule ^(.*).css $1.css.gz [QSA]      # Serve gzip compressed JS files if they exist and the client accepts gzip.     RewriteCond %{HTTP:Accept-encoding} gzip     RewriteCond %{REQUEST_FILENAME}.gz -s     RewriteRule ^(.*).js $1.js.gz [QSA]      # Serve correct content types, and prevent mod_deflate double gzip.     RewriteRule .css.gz$ - [T=text/css,E=no-gzip:1]     RewriteRule .js.gz$ - [T=text/javascript,E=no-gzip:1]      <FilesMatch "(.js.gz|.css.gz)$">       # Serve correct encoding type.       Header set Content-Encoding gzip       # Force proxies to cache gzipped & non-gzipped css/js files separately.       Header append Vary Accept-Encoding     </FilesMatch>   </IfModule> </IfModule>  </Directory>   

谈到服务器配置时,我很幸运地拼写apache。我已经用了一些设置,但我感觉很像我的深度,特别是关于Drupal MultiSite。如果有人可以指向正确的方向,那就非常感谢。

谢谢!

scott。

英文原文

We've got a multi-site install on Amazon's AWS that used the Bitnami Drupal image (ami-3f21aa56 - 64bit, Unbuntu) as a base. Per the documentation, each site has it's own subdirectory in the sites folder. Each site has a corresponding DNS A record that is pointed at our server. Drupal handles the traffic via the sites.php file and that's been working well so far.

Now I'm trying to implement Clean URLs and the test continues to fail. I've played with the Rewrite settings in the .conf files per various recommendations around the web but nothing has worked so far.

mod_rewrite is enabled. My current drupal.conf file is:

# App url moved to root DocumentRoot "/home/bitnami/apps/drupal/htdocs" #Alias /drupal/ "/opt/bitnami/apps/drupal/htdocs/" #Alias /drupal "/opt/bitnami/apps/drupal/htdocs"  <Directory "/home/bitnami/apps/drupal/htdocs">     Options +MultiViews     AllowOverride All     <IfVersion < 2.3 >     Order allow,deny     Allow from all     </IfVersion>     <IfVersion >= 2.3>     Require all granted     </IfVersion> </Directory>  # Uncomment the following lines to see your application in the root # of your URL. This is not compatible with more than one application. # RewriteEngine On # RewriteRule ^/$ /drupal/ [PT] 

The htaccess.conf (I believe this is Bitnami's way to have a global .htaccess for drupal 7, including multisite config) is as follows (apologies for the length):

<Directory "/opt/bitnami/apps/drupal/htdocs/"> # # Apache/PHP/Drupal settings: #  # Protect files and directories from prying eyes. <FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">   Order allow,deny </FilesMatch>  # Don't show directory listings for URLs which map to a directory. Options -Indexes  # Follow symbolic links in this directory. # Options +FollowSymLinks  # Make Drupal handle any 404 errors. ErrorDocument 404 /index.php  # Set the default handler. DirectoryIndex index.php index.html index.htm  # Override PHP settings that cannot be changed at runtime. See # sites/default/default.settings.php and drupal_environment_initialize() in # includes/bootstrap.inc for settings that can be changed at runtime.  php_value memory_limit 64M  # PHP 5, Apache 1 and 2. <IfModule mod_php5.c>   php_flag magic_quotes_gpc                 off   php_flag magic_quotes_sybase              off   php_flag register_globals                 off   php_flag session.auto_start               off   php_value mbstring.http_input             pass   php_value mbstring.http_output            pass   php_flag mbstring.encoding_translation    off </IfModule>  # Requires mod_expires to be enabled. <IfModule mod_expires.c>   # Enable expirations.   ExpiresActive On    # Cache all files for 2 weeks after access (A).   ExpiresDefault A1209600    <FilesMatch \.php$>     # Do not allow PHP scripts to be cached unless they explicitly send cache     # headers themselves. Otherwise all scripts would have to overwrite the     # headers set by mod_expires if they want another caching behavior. This may     # fail if an error occurs early in the bootstrap process, and it may cause     # problems if a non-Drupal PHP file is installed in a subdirectory.     ExpiresActive Off   </FilesMatch> </IfModule>  # Various rewrite rules. <IfModule mod_rewrite.c>   RewriteEngine on    # Block access to "hidden" directories whose names begin with a period. This   # includes directories used by version control systems such as Subversion or   # Git to store control files. Files whose names begin with a period, as well   # as the control files used by CVS, are protected by the FilesMatch directive   # above.   #   # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is   # not possible to block access to entire directories from .htaccess, because   # <DirectoryMatch> is not allowed here.   #   # If you do not have mod_rewrite installed, you should remove these   # directories from your webroot or otherwise protect them from being   # downloaded.   RewriteRule "(^|/)\." - [F]    # If your site can be accessed both with and without the 'www.' prefix, you   # can use one of the following settings to redirect users to your preferred   # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:   #   # To redirect all users to access the site WITH the 'www.' prefix,   # (http://example.com/... will be redirected to http://www.example.com/...)   # uncomment the following:   # RewriteCond %{HTTP_HOST} !^www\. [NC]   # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]   #   # To redirect all users to access the site WITHOUT the 'www.' prefix,   # (http://www.example.com/... will be redirected to http://example.com/...)   # uncomment the following:   # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]   # RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]    # Modify the RewriteBase if you are using Drupal in a subdirectory or in a   # VirtualDocumentRoot and the rewrite rules are not working properly.   # For example if your site is at http://example.com/drupal uncomment and   # modify the following line:   RewriteBase /drupal   #   # If your site is running in a VirtualDocumentRoot at http://example.com/,   # uncomment the following line:   RewriteBase /    # Pass all requests not referring directly to files in the filesystem to   # index.php. Clean URLs are handled in drupal_environment_initialize().   RewriteCond %{REQUEST_FILENAME} !-f   RewriteCond %{REQUEST_FILENAME} !-d   RewriteCond %{REQUEST_URI} !=/favicon.ico   RewriteRule ^ index.php [L]    # Rules to correctly serve gzip compressed CSS and JS files.   # Requires both mod_rewrite and mod_headers to be enabled.   <IfModule mod_headers.c>     # Serve gzip compressed CSS files if they exist and the client accepts gzip.     RewriteCond %{HTTP:Accept-encoding} gzip     RewriteCond %{REQUEST_FILENAME}\.gz -s     RewriteRule ^(.*)\.css $1\.css\.gz [QSA]      # Serve gzip compressed JS files if they exist and the client accepts gzip.     RewriteCond %{HTTP:Accept-encoding} gzip     RewriteCond %{REQUEST_FILENAME}\.gz -s     RewriteRule ^(.*)\.js $1\.js\.gz [QSA]      # Serve correct content types, and prevent mod_deflate double gzip.     RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]     RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]      <FilesMatch "(\.js\.gz|\.css\.gz)$">       # Serve correct encoding type.       Header set Content-Encoding gzip       # Force proxies to cache gzipped & non-gzipped css/js files separately.       Header append Vary Accept-Encoding     </FilesMatch>   </IfModule> </IfModule>  </Directory> 

When it comes to server configuration, I am lucky to spell Apache. I've played with a few settings but I am feeling quite out of my depth, especially with regard to Drupal Multisite. If someone can point me in the right direction, it would be very much appreciated.

Thanks!

Scott.

        

回答列表

1
 
vote

听起来它可能是 http://drupal.org/node/488188

  • 编辑/etc/httpd/conf/httpd.conf
  • 在&lt; directory / var / www / html&gt;
  • 更改allowoverride none以allowoverider all
 

Sounds like it might be a similar problem to http://drupal.org/node/488188

  • edit /etc/httpd/conf/httpd.conf
  • Under <Directory /var/www/html>
  • change AllowOverride None to AllowOverride All
 
 

相关问题

1  搜索页面?  ( Search through page titles ) 
是假设通过节点/页面搜索的搜索模块,或者只是节点内容? 因为,对我来说,它只是搜索内容,而不是页面标题。 注意:我正在使用drupal 7。 ...

1  创建视图以向用户显示他/她被标记的标志  ( Creating a view to show a user the flag he she has been flagged with ) 
我为用户创建了3个标志,只有管理员可以标记它。让我们说标志的名字是"酷" ,"无聊" ,"超级" 。管理员进入用户A的配置文件,并用"酷" 和"超级" 标志标记他。现在,当'a'登录时,他/她应该看到这样的看法: Flags: Super Cool 如何实现此视图。 ...

1  让用户每类别投票给一个节点  ( Letting users vote for one node per category ) 
我正在为一年为D7网站工作,每年为一年时间为"最佳的城镇" 竞争,企业提交列表(每个节点并放置在分类系统中)和用户在六个类别中的每一个中投票在上述分类学中。 drupal似乎有很多投票模块,朝向x(即fivestar)的排名,但是在一系列类别中选择一个(且只有一个)节点。任何想法我是怎么做到的? 谢谢! ...

4  如何在.tpl.php文件中的特定位置  ( How set div in a specific position inside tpl php file ) 
我在我的网站中使用视图模块(内置Drupal-7)。我有一个自定义主题。 我已经设置了一个视图 - 视图 - 字段 - xx .tpl.php,如下。 <?php /**` * Default simple view template to all the fields as a row. * ...

1  获取错误“$()。一旦不是函数”[已关闭]  ( Getting the error once is not a function ) 
关闭。这个问题需要更多聚焦。它目前不接受答案。 想要改进这个问题?更新问题,因此它仅关注一个问题,只有编辑此帖。 关闭 6年前。 ...

0  如何将URL映射到附件  ( How to map a url to an attachment ) 
我想为pdf文件有一个简单而干净的网址,例如 http://www.examples/file1 将其映射到Drupal节点中的附件,而不是使用 http://www.examples/sites/default/files/files/file1.pdf 我已经尝试使用URL别名,但是Drupa...

0  我用自定义模块收到此错误,有关追踪问题的任何建议?  ( I get this error with my custom module any advice on tracking down the problem ) 
当我选择一个选项时,我会收到此错误。 http://i.stack.imgur.com/acmdg.png drupal看门狗日志错误详细信息 p> p> p> p> p> [42s02]:找不到基本表或视图:1146表"idest.chimeare.field_data_field_for_date...

1  如何验证自定义窗口小部件?  ( How to validate a custom widget ) 
我已经创建了一个自定义窗口小部件,我想添加一些验证。具体地,如果窗口小部件按要求标记,请检查它实际上是否输入了值。我认为这应该非常直接,但谷歌曲没有返回我正在寻找的任何结果。可能使用错误的搜索字词。如果有人可以提供关于如何执行此操作的链接或提供一些大的提示! 谢谢。 ...

1  如何将版权/名称站点放在页脚中  ( How do i put the copyright name site in footer ) 
在我尝试之前尝试的四个主题中,在选择我现在拥有的一个主题之前,我的网站的名称始终在我的网页的页脚中有版权,但现在所有它所说的是"版权©2013" ​​,< / p> 是否有一种简单的方法来调整代码,以便在该逗号和期间之前进行信用的网站?我对代码不太熟悉,所以我永远非常感激。我试图在几页中寻找版权标志和年份,但他们没有...

2  如何在慢速页面加载时显示“加载”图标?  ( How can i display a loading icon while a slow page loads ) 
我有一个自定义模块,由于广泛的数据库工作导致的前端页面速度慢增加(无表单,只有一堆DB查询显示一些长表)。我想在页面加载时添加小"加载" 图标(类似于iPhone),以向用户显示页面正在工作。我在一些观点管理页面上看到了它,但我似乎无法找到它的代码。是使用jQuery还是Drupal模块完成的显示代码?如何将代码添加...

4  Field_deleted_date_n和field_deleted_revision_n在cron运行或field_purge_batch()上未删除  ( Field deleted date n and field deleted revision n not removed on cron run or fie ) 
我在d7上运行一个网站。我注意到了一个没有。 stair_deleted_data_n和cife_deleted_revision_n表中的数据库中的表。通过很多Googling,我发现人们说这些表最终将在Cron Run上清除。他们还表示你可以运行field_purge_batch()。 然而,没有建议工作。有人可...

2  如何使用规则发送一次登录URL?  ( How to send one time login url with rules ) 
我有规则要创建用户和一个操作,以向用户的电子邮件发送登录URL。我没有找到发送登录URL的任何操作,因此添加了一个发送HTML电子邮件操作,并在邮件正文中添加了 [user-created:one-time-login-url] 令牌。但它出现在它( [用户创建的:一次性登录 - url] ),并且未翻译为登录UR...

1  每个项目的序列号[已关闭]  ( Serial number for each item ) 
关闭。这个问题需要更多聚焦。它目前不接受答案。 想要改进这个问题?更新问题,因此它仅关注一个问题,仅通过编辑此帖。 closed 1年前。 ...

2  提取视图$行值  ( Extract views row values ) 
我已创建一个过滤内容的视图。我想使用自定义TPL并获取$行变量的值。如何提取这些valuse? 例如: <?php foreach ($rows as $id => $row): ?> <div class="<?php print $classes_array[$id]; ?>"><?php print ...

2  存储哪个表是存储的现场实例窗口小部件设置?每次保存节点时是否可以更新这些?  ( Which table are field instance widget settings stored is it ok to update these ) 
我想利用整数实例设置的最小/最大值。我想知道这些存储在数据库中,是否可行使用 hook_node_save 或保存以更新这些min / max字段。该站点将使用源对大规模导入节点,并且我想知道是否可以在运行饲料导入时更新这些值是否可以进行更新? 还有一种简单的方法来抓住节点视图上的这些min / max值吗? ...

2  当调用form_set_error时嵌入式视图结果丢失  ( Embedded view results being lost when form set error is being called ) 
我有一个页面(user profile.tpl.php),自定义表单和嵌入在tpl.php文件中的视图。 自定义表单在自定义模块中定义,验证和提交挂钩,视图正在以编程方式显示: $view = views_get_view('accounts_for_user'); $view->set_display('pan...

4  添加JS文件并确保将其作为上一个js文件执行?  ( Add a js file and be sure it is executed as last js file ) 
我需要添加一个js文件,使其成为最后一个js文件(毕竟属于模块的j)来执行 我为此创建一个模块。但我无法管理模块执行的顺序。我不是吗? ◆我应该在我的主题中或通过功能添加此文件? ...

4  如何列出引用树视图中的节点的所有节点  ( How to list all nodes referencing a node in a tree view ) 
我有一个内容类型 company ,一个实体参考字段,它可以引用相同类型(公司)的内容,这个字段也设置为具有多个值。 我想要实现的是列出引用公司的所有公司,作为递归树(可能只是前2-3级)。 例如,我有5家公司:公司,CompanyB,Companyc,Companyd,公司。他们每个人都参考一个或多个公司。让我们...

2  DRUSH PERM-GRANT给出“无法找到”DRUSH命令'PERM-GRANT'“  ( Drush perm grant gives the drush command perm grant could not be found ) 
我正在使用 drush -u 15 perm-grant --roles="site administrator" 但命令返回: 无法找到"疏水命令'perm-grant'。 对此的任何想法?根据 文档 drush perm-grant 是一个可用的命令。或者也许是用户使用的一些限制才能运行溺水? 润滑版为5.4...

0  编辑分配域的用户  ( Edit users of assigned domain ) 
我需要在域中像'domainadmin'这样的角色可以仅编辑分配的域的用户而不是另一个域。这是否可以使用域访问本身或其他模块? ...




© 2021 it.wenda123.org All Rights Reserved. 问答之家 版权所有


Licensed under cc by-sa 3.0 with attribution required.