0
不工作,我之前使用XAMPP服務器,這是我在XAMPP服務器的網站代碼,它是工作完全正常.htaccess文件在新的服務器
ErrorDocument 404 /website/error404.html
RewriteEngine On
RewriteRule ^([0-9A-Za-z-]+)/?$ user.php?name=$1 [NC,L]
但是,現在我帶來了真正的域和一臺服務器,並轉移了我的整個網站。這是我的新的.htaccess代碼,這是行不通的
ErrorDocument 404 http://example.com/error404.html
RewriteEngine On
RewriteRule ^/([0-9A-Za-z-]+)/?$ http://example.com/user.php?name=$1 [NC,L]
錯誤文檔工作完全正常。但不是東西RewriteEngine敘述,我使用,使友好的URL的
變化:
我^
之後和之前([0-9A-Za-z-]+)
而不是使用user.php
添加/
,我使用http://example.com/user.php
我認爲,mod_rewrite
引擎是ON
,在我的託管上:http://prntscr.com/fksdwj
確認您的託管服務提供商是否在 – Akintunde007
上有重寫模式請問您有兄弟嗎? http://prntscr.com/fksdwj @Akintunde – Josh
假設您使用的是Apache ...請確保mod_rewrite已配置並在默認的Apache配置中處於活動狀態(應位於以下位置:/ etc/apache2/sites-enabled/000- default.conf) – mele