1
我一直在使用apache成功地在不同的服務器上使用.htaccess,但由於某種原因,我無法得到它在這個新的託管軟件包上工作,因爲我不斷收到「Page not found」屏幕上顯示以下消息:「在此服務器上未找到請求的URL/about-us」。 網址瀏覽器看起來就像這樣:www.mysite.com/about-us.htaccess轉到404 - url重寫
我的代碼如下:
RewriteEngine on
Options +FollowSymlinks
DirectoryIndex index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?mode=$1 [L,QSA]
任何幫助表示讚賞 感謝
您的新託管服務提供商是否支持mod_rewrite? – 2012-01-30 15:18:49
我在 中添加了我的代碼。我將DirectoryIndex index.php更改爲DirectoryIndex index.htm index.php,現在該站點將我帶到index.htm。我想這意味着啓用了mod重寫。 –
fred
2012-01-30 15:27:54
答案: 'RewriteRule ^(。*)$ /index.php?mode=$1 [L,QSA]' – fred 2012-01-30 17:21:11