dongxun1142 2013-09-23 12:07
浏览 19

是否可以使用htaccess隐藏hancoded index.php

i have few hancoded links in my site ,some thing like this

<li><a href="<?php echo $url.'/index.php/bla/bla1'?>"><span>Bla bla bla</span></a></li>

My Question is ?Is it possible to remove thoose index.php using .htaccess(putting it into the root folder) by writting this in it

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Removes index.php from ExpressionEngine URLs
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
  • 写回答

2条回答 默认 最新

  • dongnaigu2052 2013-09-23 12:36
    关注

    you can do It with jQuery,check every href attribute to match your pattern, and change it. It's not so pretty but anyway ,like:

    $.each($('a') , function(key , value){
    ...
    

    define your pattern here and change the url ...

    $(value).attr('href' , newHref);
    });
    
    评论

报告相同问题?

悬赏问题

  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码