【问题标题】:.htaccess redirect subdirectory to index.php.htaccess 将子目录重定向到 index.php
【发布时间】:2014-04-18 15:32:23
【问题描述】:

我想rewrite 网址喜欢:
http://domain.com/index.php/subdirectory/subdirectory/
至: http://domain.com/index.php

我的重写规则如下所示:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !(.*) 
RewriteRule ^(.*)$ index.php$  [L]

谢谢,

【问题讨论】:

    标签: .htaccess mod-rewrite


    【解决方案1】:

    重写条件

    RewriteCond %{REQUEST_URI} !(.*) 
    

    永远是假的,你不需要它。只需使用:

    RewriteEngine On
    RewriteRule ^(.*)$ index.php  [L]
    

    【讨论】:

      猜你喜欢
      • 2012-04-27
      • 2017-01-12
      • 2014-05-14
      • 1970-01-01
      • 2013-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-22
      相关资源
      最近更新 更多