0
我的供應商1天前更新服務器(我不知道上一版本)。 現在重寫不起作用指數包括,執行和重定向: http://testdomena.com - >http://testdomena.com/index/index(即正確的) 但在那之後,我看到:升級後.htaccess不起作用
Not Found
The requested URL /index/index was not found on this server.
Apache/2.4.7 (Ubuntu) Server at testdomena.com Port 80
地址是正確的,更新前的所有工作。
現在我serwer看起來像:
- 的Ubuntu 14.04.5 LTS(GNU/Linux的3.13.0-108泛型x86_64的)
- Server版本:阿帕奇/ 2.4.7(Ubuntu的)
- PHP 5.5.9-1
apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<directory /var/www/>
options indexes followsymlinks
allowoverride none
require all granted
</directory>
<directory /home/>
options indexes followsymlinks
allowoverride none
require all granted
</directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
個testdomena.conf
<VirtualHost *:80>
ServerName testdomena.com
DocumentRoot /home/web/testdomena
<Directory /home/web/testdomena/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
的.htaccess
SetEnv APPLICATION_ENV "production"
Options +FollowSymlinks -Indexes
RewriteEngine On
RewriteBase/
# No www in url
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ http://testdomena.com/$1 [R=301,L]
# Maintain page
RewriteCond %{DOCUMENT_ROOT}/index.php !-f
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* maintain.php [PT,L]
# Files and dirs are not welcome
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(media|styles)/?
# And we don't want to check www subdomain
RewriteCond %{HTTP_HOST} !=www.testdomena.com
RewriteRule .* index.php [PT,L]
從零件的phpinfo()
Loaded Modules
core mod_somod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_filter mod_headers mod_mime prefork mod_negotiation mod_php5 mod_reqtimeout mod_rewrite mod_setenvif mod_socache_shmcb mod_ssl mod_status
http://stackoverflow.com/questions/24426690/problems-with-htaccess-after-upgrading-to-php-5-4 –