我在gplus
路径中有一个名为/var/www
的目录。我的配置文件,即guwahatiplus.com.conf
如下
<VirtualHost *:80>
ServerAdmin nitish@guwahatiplus.com
ServerName guwahatiplus.com
ServerAlias www.guwahatiplus.com
DocumentRoot /var/www/gplus/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/gplus>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
我的mod_rewrite已开启。 .htaccess
文件是
RewriteEngine On
Options +MultiViews
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
现在,如果我转到网址http://www.guwahatiplus.com/gplustest.php,则显示,但http://www.guwahatiplus.com/gplustest不显示。怎么了。
注意:我已在Digitalocean