【问题标题】:create core php file in yii framework在 yii 框架中创建核心 php 文件
【发布时间】:2015-07-03 22:21:21
【问题描述】:

我想使用直接从 web url 访问来访问 yii 中的核心 php 文件

我的 htaccess 是

   <IfModule mod_rewrite.c>
      RewriteEngine On

# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
 </IfModule>

谢谢

【问题讨论】:

  • 直接把你的文件放到你的index.php所在的根目录
  • 但它无法正常工作,我面临找不到网址
  • 我刚刚测试过,它正在工作。创建新文件 test.php 放置 index.php 文件并访问 url,如 yourdomain.com/test.php
  • 感谢您的工作时间

标签: php .htaccess yii


【解决方案1】:

通过为您的文件名添加例外来更新

RewriteCond %{REQUEST_URI} !^/yourfile\.php$ 

【讨论】:

  • 添加到下面#RewriteBase /
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-04-08
  • 1970-01-01
  • 1970-01-01
  • 2013-09-13
  • 2015-11-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多