我使用的是Wamp 2.4,但必須卸載它並在3.0.8更新旁邊安裝3.0.6。通過選擇wamp托盤設置中的Add localhost選項並在應用程序的配置文件中的.htaccess和http // localhost/mysitefolder中聲明/ mysitefolder /,一切正常。WampServer站點URL不能在沒有本地主機前綴的情況下工作
但我喜歡使用虛擬主機的想法,尤其是通過提供的GUI形式通過接口創建VH。我在V3.6安裝之前創建了一個我正在開發的項目的VH。現在我編輯了我正在處理的codeigniter代碼的.htaccess和config文件,以便將默認情況下我可以導航到http://mysitefolder,而不是localhost/mysitefolder。
問題:指向http://mysitefolder顯示正確但點擊任何鏈接的子頁面結果在同一個瀏覽器錯誤:
"Not Found The requested URL /mysitefolder.txt/index.php was not found on this server. Apache/2.4.23 (Win32) PHP/5.6.25 Server at mysitefolder Port 80"
首先,我不明白的地方.txt擴展名從我發出不知道如何去解決這個問題。
使用Windows 8.1,選擇了mod重寫的Apache 2.4.3。
請注意。
APACH VHOST文件
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName financejobs
ServerAlias financejobs
DocumentRoot "c:/wamp/www/financejobs"
<Directory "c:/wamp/www/financejobs">
AllowOverride All
Require local
</Directory>
</VirtualHost>
笨應用HTACCSS(用於financejobs)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /financejobs/
RewriteCond %{REQUEST_URI} ^jp_sys.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^jp_app.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
Options -Indexes
你可以添加你的.htaccess和你的虛擬主機? –
@AndrewOsenga我已經添加了那些 – Ojchris
嘗試更改'RewriteBase/financejobs /'到'RewriteBase /' – Condorcho