Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将管理模块添加到web应用程序时遇到问题_Php_.htaccess_Url Rewriting_Url Routing - Fatal编程技术网

Php 将管理模块添加到web应用程序时遇到问题

Php 将管理模块添加到web应用程序时遇到问题,php,.htaccess,url-rewriting,url-routing,Php,.htaccess,Url Rewriting,Url Routing,我的应用程序在url上运行,例如: 它工作得很好。现在,我想将管理员部分添加到我的应用程序中,该应用程序的url为:将自动将它们重定向到管理员的登录页()。我希望这个管理模块的工作完全分开。因此,我有以下文件夹结构: 应用程序 配置 控制器 管理员 Accounts.php Products.php Homes.php Products.php 核心 模型 User.php Product.php 观点 -管理员 -产品 -index.php -login.php 产品 in

我的应用程序在url上运行,例如: 它工作得很好。现在,我想将管理员部分添加到我的应用程序中,该应用程序的url为:将自动将它们重定向到管理员的登录页()。我希望这个管理模块的工作完全分开。因此,我有以下文件夹结构:

  • 应用程序
    • 配置
    • 控制器
      • 管理员
        • Accounts.php
        • Products.php
      • Homes.php
      • Products.php
    • 核心
    • 模型
      • User.php
      • Product.php
    • 观点 -管理员 -产品 -index.php -login.php
      • 产品
        • index.php
        • index.php
    • .htaccess
  • 公开的
    • 资产
    • .htaccess
    • index.php
  • 卖主
  • .htaccess
我有三个.htaccess文件。我很困惑,我必须修改哪个.htaccess文件才能让用户重定向到
http://mywebsite.com/admin/products/login
如果他们转到
http://mywebsite.com/admin
。我在所有三个.htaccess文件中都有以下代码:

**.htaccess(在根文件夹中)**

如有任何建议和帮助,将不胜感激

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule  ^$ public/ [L]
    RewriteRule  (.*) public/$1 [L]
</IfModule>
<IfModule mod_rewrite.c>
    Options -Multiviews
    RewriteEngine On
    RewriteBase /mywebsite/public
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule  ^(.+)$ index.php?url=$1 [QSA,L]
</IfModule>
Options -Indexes