我正在尝试设置重写规则,以便将 localhost/test/{this} 之后的任何内容转发到 localhost/test/index.php?{here}
我可以访问服务器,当前配置如下所示:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Directory /var/www/test/>
AllowOverride All
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ index.php?$1
</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
但是目前,在访问 localhost/test/something 时没有显示 /localhost/test/index.php?something 它显示 localhost/index.php 所以它重写到错误的地方..有什么想法吗?谢谢