我试图改变的模式。将wordpress文件夹中的htaccess转到644。然而,我明白
Not Found
The requested URL /wordpress/features/ was not found on this server.
我一直在读关于重新安排工作的书。htaccess以使永久链接正常工作。无法理解。
以下是我的详细信息。htaccess
# Comment
DirectoryIndex index.html index.htm index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{QUERY_STRING} (^|\\?|&)s2member_file_download\\=.+
RewriteRule .* - [E=no-gzip:1]
</IfModule>
# BEGIN FlexiCache Standalone
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} localhost$
RewriteCond %{REQUEST_METHOD} GET
RewriteCond %{REQUEST_URI} !^/wp-
RewriteCond %{HTTP_COOKIE} !(wordpress_logged_in|comment_author|wp-postpass)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*) wp-content/plugins/flexicache/standalone.php [L]
</IfModule>
# END FlexiCache Standalone
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\\.0[678] no-gzip
BrowserMatch \\bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \\bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>
</IfModule>
<FilesMatch "\\.(css|js|htc|CSS|JS|HTC)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header set Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag None
<IfModule mod_headers.c>
Header set X-Powered-By "W3 Total Cache/0.9.2.4"
</IfModule>
</FilesMatch>
<FilesMatch "\\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|HTML|HTM|RTF|RTX|SVG|SVGZ|TXT|XSD|XSL|XML)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header set Cache-Control "max-age=3600, public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag None
<IfModule mod_headers.c>
Header set X-Powered-By "W3 Total Cache/0.9.2.4"
</IfModule>
</FilesMatch>
<FilesMatch "\\.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip|ASF|ASX|WAX|WMV|WMX|AVI|BMP|CLASS|DIVX|DOC|DOCX|EOT|EXE|GIF|GZ|GZIP|ICO|JPG|JPEG|JPE|MDB|MID|MIDI|MOV|QT|MP3|M4A|MP4|M4V|MPEG|MPG|MPE|MPP|OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|PNG|POT|PPS|PPT|PPTX|RA|RAM|SVG|SVGZ|SWF|TAR|TIF|TIFF|TTF|TTC|WAV|WMA|WRI|XLA|XLS|XLSX|XLT|XLW|ZIP)$">
<IfModule mod_headers.c>
Header set Pragma "public"
Header set Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate"
</IfModule>
FileETag None
<IfModule mod_headers.c>
Header set X-Powered-By "W3 Total Cache/0.9.2.4"
</IfModule>
</FilesMatch>
# END W3TC Browser Cache
# BEGIN s2Member GZIP exclusions
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteCond %{QUERY_STRING} (^|\\?|&)s2member_file_download\\=.+
RewriteRule .* - [E=no-gzip:1]
</IfModule>
# END s2Member GZIP exclusions
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
# BEGIN Security advice from http://www.problogdesign.com/wordpress/11-best-ways-to-improve-wordpress-security/
# 8 – No Directories Should be Available for Browsing
# By default in most hosting, index of directories are shown in web browsers. This has a purpose but it also means that you reveal the content of any directory that has no index.html or index.php.
# Modifying this behavior is easy with Apache, just add the following line of code to the .htaccess file in the root directory (In the same place as the wp-config.php file).
Options All -Indexes
# END Security advice
编辑:停用所有插件
sudo a2enmod rewrite
和
sudo /etc/init.d/apache2 restart
. 启用永久链接,刷新页面。这个htaccess文件已自动创建。主页显示正常(一如既往),其他页面/链接均不起作用。我在本地主机上试过了。我的网站位于www.mcruiseon。com公司
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
最合适的回答,由SO网友:Damien 整理而成
听起来您的VHOST的Allow Override指令仍然设置为NONE
默认情况下,这是禁用的,因此即使您通过sudo a2enmod rewrite
你的htaccess将被忽略。
您需要登录到服务器(通过终端/外壳),然后。。。
sudo nano /etc/apache2/sites-available/default
在文件中查找:
<Directory /var/www/>
AllowOverride None
Options MultiViews FollowSymlinks
Order allow,deny
Allow from all
Header Set Cache-Control no-cache
</Directory>
将AllowOverride更改为ALL
Ctrl+x并保存文件
然后
sudo apache restart
或sudo /etc/init.d/apache2 restart
另见http://drupal.org/node/134439
请告诉我允许覆盖是否已关闭?