在服务器

时间:2017-06-26 03:38:58

标签: php .htaccess url-rewriting cpanel

我在localhost中有项目,我应用重写简单规则,它在localhost中工作正常。当我在cpanel上传时。重写url(htaccess)仅适用于一个页面但不适用于其他页面。意味着它给我500个内部错误。我将Profile.php转换为domain.com/profile,将about-us.php转换为domain.com/about-us,但它给了我500个错误

# Turn Rewrite Engine On                                        
RewriteEngine on                                                  
RewriteRule ^profile$ Profile.php [NC,L]                          
RewriteRule ^profile-setting$ User-Profile.php [NC,L]             
RewriteRule ^checkout$ checkout.php [NC,L]                        
RewriteRule ^summer-store$ product.php [NC,L]

只有最后一个product.php页面在localhost和cpanel中都有效,但是其他只能在localhost上工作而不是在cpanel中(500错误)。问题存在。很多人提前感谢

1 个答案:

答案 0 :(得分:1)

如果您拥有托管网站的服务器的root访问权限,只需使用root用户登录服务器,并在浏览有问题的页面时检查路径/ usr / local / apache / logs / error_log中的日志。错误日志将显示发生了什么,然后您可以相应地应用修复。