dongshan3806 2013-05-11 06:11 采纳率: 0%
浏览 53

.htaccess 404页面没有显示

I have one website, for that only error page is displaying for the main url. e.g.: 404 error page is displayed in www.example.com/123.

When I go any other pages e.g.: www.example.com/about.php/123, the error page is not displayed. Only the same page without style sheet is displayed.

Here's my htaccess code:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f``
RewriteCond %{REQUEST_FILENAME} !-d
ErrorDocument 404  http://www.example.com/404.php

Please help me to redirect to 404 pages when someone type wrong urls for the pages with the php extension (eg: index.php, about.php, contact.php etc)

  • 写回答

1条回答 默认 最新

  • dongpu8935 2013-05-11 11:30
    关注

    You try this code as per your page name and need some changes in " .htaccess " file.

    **RewriteRule ^([a-zA-Z_-]+)$ index.php?action=$1 
    RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)$ index.php?action=$1&mode=$2
    RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)/([0-9]+)$ index.php?action=$1&mode=$2&id=$3**
    

    I hope solve the your problem.

    评论

报告相同问题?

悬赏问题

  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算