doulingna9420 2016-11-26 05:35
浏览 67
已采纳

忽略.htaccess的子文件夹

In my public_html I have 2 Folders, wordpress and tickets. I currently have the /wordpress directory working via mod_rewrite so that the URL's look nice. I'd like to setup an instance of OSTicket, and upon navigating to example.com/tickets to start the configuration, I'm hit with a Wordpress 404 error.

My root .htaccess looks like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/tickets/.*
RewriteRule ^tickets - [L,NC]
RewriteRule ^index\.php$ /wordpress/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

I also have a .htaccess in the tickets folder, with;

RewriteEngine off

If anyone has some insight or perhaps something I should look into it would be most appreciated, thankyou all kindly.

  • 写回答

1条回答 默认 最新

  • drwpbrv668670 2016-11-26 12:47
    关注
    1. The condition you have is the opposite of your match. They can't both be right. Drop the condition permanently, and amend the rule to this:

      RewriteRule ^tickets(?:$|/) - [L]
      

      That ensures /tickets-foo/ still goes to WordPress and that you're not matching case-insensitively when your filesystem is case-sensitive.

    2. Temporarily rename the tickets dir. Create another one with only an index document in it, content is irrelevant but put something in. Visit example.com/tickets and you should see your aforementioned content.

    I'm betting the issue is not in the .htaccess nor WordPress.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 关于用python写支付宝扫码付异步通知收不到的问题
  • ¥50 vue组件中无法正确接收并处理axios请求
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 MATLAB联合adams仿真卡死如何解决(代码模型无问题)
  • ¥15 基于pso参数优化的LightGBM分类模型
  • ¥15 安装Paddleocr时报错无法解决
  • ¥15 python中transformers可以正常下载,但是没有办法使用pipeline
  • ¥50 分布式追踪trace异常问题
  • ¥15 人在外地出差,速帮一点点
  • ¥15 如何使用canvas在图片上进行如下的标注,以下代码不起作用,如何修改