我正在尝试使用mod_rewrite for Apache将流量从我的delopment url路由到我的MCV控制器。但我不断收到“内部服务器错误”。
方面: Windows 10,WAMP
Localhost网址:taskmanager.local
.htaccess文件:
type User @model {
id: ID! @isUnique
position: Position
}
type Position {
lat: Int
lng: Int
}
虚拟主机:
<IfModule mod_rewrite.c>
Options -Multiviews
RewriteEngine On
RewriteBase taskcomplete.local/public
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
</IfModule>
答案 0 :(得分:0)
好的,所以经过一些随机的摸索后我解决了这个问题。我对.htaccess
文件和httpd-vhost.conf
文件以及所有内容进行了一些更改,现在localhost
网址指向了/public
文件夹。
.htaccess文件:
<IfModule mod_rewrite.c>
Options -Multiviews
RewriteEngine On
RewriteBase /public
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
</IfModule>
taskcomplete.local/public
=&gt; /public
虚拟主机:
# TaskComplete
<VirtualHost *:80>
DocumentRoot "D:\Dropbox\web\projects\php\task_complete"
ServerName taskcomplete.local
<Directory "D:\Dropbox\web\projects\php\task_complete">
Options Indexes FollowSymLinks ExecCGI Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
D:\Dropbox\web\projects\php\task_complete
=&gt; D:\Dropbox\web\projects\php\task_complete\public