duanfei1268 2012-03-08 10:18
浏览 39

TinyMCE与htaccess冲突

I have configured my server using htaccess so that I can route all URL's into a PHP $_GET parameter. I want the URLs on the site to finish with .htm. Currently I have this htaccess, and I have never had any problems with it:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ajax/([A-Z,a-z,0-9,\_/]*).htm$ index.php?route=$1&opformat=ajax [QSA]
RewriteRule ^([A-Z,a-z,0-9,\_/]*).htm$ index.php?route=$1 [QSA]

However I have just installed TinyMCE which uses .htm files in the js folder e.g. "/js/tinymce/prop.htm". For some reason when this URL is entered my htaccess routes it to php and it doesn't work.

I was given to understand that RewriteCond %{REQUEST_FILENAME} !-f should stop this from happening. Why is it not? RewriteCond %{REQUEST_FILENAME} !-d is working as I can go to "/js/tinymce" in this example and see directory listing.

Thanks.

  • 写回答

1条回答 默认 最新

  • dongliang2058 2012-03-08 13:38
    关注

    I suggest you to change your code to this:

    Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{REQUEST_FILENAME} -d [OR]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l
    RewriteRule ^ - [L]
    
    RewriteRule ^ajax/([^.]*)\.htm$ index.php?route=$1&opformat=ajax [L,QSA,NC]
    
    RewriteRule ^([^.]*)\.htm$ index.php?route=$1 [L,QSA,NC]
    
    评论

报告相同问题?

悬赏问题

  • ¥20 为什么我写出来的绘图程序是这样的,有没有lao哥改一下
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥15 绘制多分类任务的roc曲线时只画出了一类的roc,其它的auc显示为nan
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败