我的网站采用PHP编码,并在Hostinger中托管。问题是,当我想转到另一个链接时,例如联系人部分或关于部分,它会显示404 Not Found页面。但是,我在本地服务器上尝试了相同的文件,它工作正常。问题是代码还是主机提供商。
我的网站链接:http://tranvio.com
htaccess的:
RewriteEngine on
RewriteBase /public_html
RewriteRule ^details-(.*)?$ index.php?a=details&id=$1 [L]
RewriteRule ^recovery-(.*)?$ index.php?a=recovery&hash=$1 [L]
RewriteRule ^refid=(.*)?$ index.php?refid=$1 [L]
答案 0 :(得分:1)
RewriteEngine On
RewriteRule ^testimonials?$ TESTIMONIAL_FILE_PATH_HERE [L]
将.htaccess文件放在根目录文件夹中,如果它不在那里。
答案 1 :(得分:0)
问题解决了:
将.htaccess编辑为:
RewriteEngine on
RewriteBase /
RewriteRule ^(login|register|forgot-
password|testimonials|logout|submit-testimonial)?$ index.php?a=$1 [L]
RewriteRule ^page/(contact|about|faq|privacy-policy|terms-of-service)?$
index.php?a=page&b=$1 [L] RewriteRule ^account/(exchanges|wallet|wallet_exchange|deposit|referrals|settings|with
drawals|withdrawal)?$ index.php?a=account&b=$1 [L]
RewriteRule ^account/exchanges/(.*)?$ index.php?
a=account&b=exchanges&page=$1 [L]
RewriteRule ^account/exchange/(.*)?$ index.php?
a=account&b=exchange&id=$1 [L]
RewriteRule ^account/referrals/(.*)?$ index.php?
a=account&b=referrals&page=$1 [L]
RewriteRule ^ref/(.*)?$ index.php?refid=$1 [L]
RewriteRule ^password-recovery/(.*)?$ index.php?a=password-
recovery&hash=$1 [L]
RewriteRule ^become_payment/(.*)?$ index.php?a=become_payment&id=$1 [L]`