douzi3756 2017-06-25 19:38 采纳率: 100%
浏览 21
已采纳

在服务器中使用htaccess时出错500错误

i have project in localhost , i apply the rewrite simple rule , it's work fine in localhost .when i upload in cpanel .Rewrite url (htaccess) work only for one page but not for others . means its give me 500 internal error. i convert Profile.php to domain.com/profile and about-us.php to domain.com/about-us but it give me 500 error

# 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]

only last product.php page work in both localhost and cpanel , but other only work on localhost not in cpanel(500 error) .Where is the Problem Exist.Many Thanks in Advance

  • 写回答

1条回答 默认 最新

  • duankuang1046 2017-06-26 18:35
    关注

    If you have root access of the server where the website is hosted , just login to the server with root user and check the logs at path /usr/local/apache/logs/error_log while browsing the pages that have issues. The error log will show you whats happening and then you can apply the fixes accordingly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部