[英]ServerName not working Zend framework2
我已經在系統上安裝了xampp和Zend framework 2。 當我運行代碼時,發送框架工作正常。 D:/ xampp / htdocs / CommunicationApp / public正常顯示
恭喜! 您已經成功安裝了ZF2 Skeleton Application。 您當前正在運行Zend Framework 2.3.4版。 該框架可以作為您在ZF2上開始構建應用程序的簡單起點。 但是當我在瀏覽器中運行服務器名稱時,顯示的是xampp localhost頁面。 請幫我創建的服務器名稱:
<VirtualHost *:80>
ServerName comm-app.local
DocumentRoot "D:/xampp/htdocs/CommunicationApp/public"
SetEnv APPLICATION_ENV "development"
<Directory D:/xampp/htdocs/CommunicationApp/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
我已經找到我的answer.just重新排列我的.htaccess文件。
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
#RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
#RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^.*$ index.php [NC,L]
重新整理.htaccess文件后重新啟動我的apache.Now工作正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.