写一个.htaccess重写规则不包括一个文件

编程入门 行业动态 更新时间:2024-10-26 11:28:22
本文介绍了写一个.htaccess重写规则不包括一个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的工作提供了一个框架,需要拨打电话到一个目录中的特定文件,但该目录设置为所有URL请求到index.php为框架的缘故。

I'm working with a framework and need to make a call to a specific file within a directory, however the directory is set up for url of all requests to index.php for the framework's sake.

我有一个名为入住session.php文件,需要的任何请求本地主机/管理/签session.php文件执行实际检查session.php文件文件,而不是路由的index.php 。我该怎么做,与同一文件夹内的.htaccess文件入住session.php文件?

I have a file called check-session.php and need any requests to localhost/admin/check-session.php to execute the actual check-session.php file instead of route to index.php. How do I do that with .htaccess file within the same folder as check-session.php?

我没有什么可以与重写规则/条件没有经验。

I have little to no experience with rewrite rules / conditions.

推荐答案

查找重写到index.php文件的重写规则和之前它把这些直接:

Find the RewriteRule that rewrites to index.php and put these directly before it:

RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_URI} !\.php$

这应该阻止它映射到index.php,如果是你要求一个真实的文件。

That should stop it mapping to index.php if it's a real file you request.

如果不工作,张贴实际重写在.htaccess

If that doesn't work, post the actual rewrites in .htaccess

更多推荐

写一个.htaccess重写规则不包括一个文件

本文发布于:2023-11-16 18:24:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606716.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重写   不包括   规则   文件   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!