我在 Ubuntu 12.10 上安装了一个 LAMP 堆栈,其中创建了三个站点/etc/apache2/sites-available
,所有站点都在运行。我的问题在于想要使用这些文件从 URL.htaccess
中附加.php
文件扩展名。我的文件目前是这样的:
# The VGC
<VirtualHost *:80>
ServerAdmin codyu@thevgc.net
ServerName thevgc.net
ServerAlias www.thevgc.net
DocumentRoot /var/www/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/www/>
Options Indexes +FollowSymLinks +MultiViews Includes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]
AddType application/x-httpd-php .php
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
我几乎可以肯定我做错了什么。我所知道的是我的.htaccess
文件拒绝附加扩展名,或者更确切地说是找到具有相同名称的文件并加载该文件,所以我想采用这种方法。
有什么建议么?这是我网站的示例页面。