dtqysxw4659 2017-03-01 09:40
浏览 56

mod_rewrite ERR_TOO_MANY_REDIRECTS

I have an issue with mod_rewrite in apache2, I had enabled the mod_rewrite but doesent load I get this message: ERR_TOO_MANY_REDIRECTS

The .htaccess:

RewriteEngine on
RewriteRule ^(\w+)$ index.php?page=$1 [L,NC,QSA]

RewriteRule ^(\w+)+\/$ index.php?page=$1 [L,NC,QSA]

RewriteCond %{HTTP_HOST} !^$

RewriteCond %{HTTP_HOST} !^www\. [NC]

RewriteCond %{HTTPS}s ^on(s)|

RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

IDK what is wrong.

  • 写回答

1条回答 默认 最新

  • dongquqiao2010 2017-03-01 10:42
    关注

    Make the .htacess easier and clean.

    RewriteEngine on 
    RewriteCond %{HTTP_HOST} !^$ 
    RewriteCond %{HTTP_HOST} !^www\. [NC] 
    RewriteRule ^/(.*) http1://www.%{HTTP_HOST}%/$1 [R=301] 
    RewriteCond "%{REQUEST_URI}" "!=/index.php" RewriteRule "^(.*)" "/index.php?page=$1" [L,PT]
    

    It solution works without SSL, as main step.

    评论

报告相同问题?

悬赏问题

  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题