2013-10-16 32 views

回答

1

問題不在於項目配置。我沒有可用的Apache的mod_rewrite:

要啓用mod_rewrite的:

a2enmod rewrite 

然後

刷新所有Apache的配置文件:

service apache2 restart 
0

1)請檢查您的.htaccess文件在你項目的rood目錄中。

Options +FollowSymLinks +ExecCGI 

<IfModule mod_rewrite.c> 
    RewriteEngine On 

    # uncomment the following line, if you are having trouble 
    # getting no_script_name to work 
    #RewriteBase/

    # we skip all files with .something 
    #RewriteCond %{REQUEST_URI} \..+$ 
    #RewriteCond %{REQUEST_URI} !\.html$ 
    #RewriteRule .* - [L] 

    # we check if the .html version is here (caching) 
    RewriteRule ^$ index.html [QSA] 
    RewriteRule ^([^.]+)$ $1.html [QSA] 

    RewriteCond %{REQUEST_FILENAME} !^favicon\.ico 
    RewriteCond %{REQUEST_FILENAME} !-f 
    # no, so we redirect to our front web controller 
    RewriteRule ^(.*)$ index.php [QSA,L] 

</IfModule> 

2)你能夠使用像這樣的URL訪問嗎?

h ttp://127.0.0.1:9898/index.php

+0

謝謝您的回覆。我已經找到了解決這個問題的方法。我與Ubuntu的工作,我沒有可用的Apache的mod_rewrite。 – kiduxa