Php 如何在MVC架构中使用静态脚本?
我使用了url重写和.htaccess 这是.htaccess文件内容Php 如何在MVC架构中使用静态脚本?,php,.htaccess,Php,.htaccess,我使用了url重写和.htaccess 这是.htaccess文件内容 Options -MultiViews RewriteEngine On # Disallows others to look directly into /public/ folder Options -Indexes RewriteBase /myMVC/ # General rewrite rules RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUE
Options -MultiViews
RewriteEngine On
# Disallows others to look directly into /public/ folder
Options -Indexes
RewriteBase /myMVC/
# General rewrite rules
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
index.php
<html>
<head>
<link href="public/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
</html>
问题
我看不到任何与boostrap css文件相关的样式
加载此url时:http://localhost/myMVC/user
它正在工作。但是当我使用这个url时:http://localhost/myMVC/user/login
它不工作
文件结构
文件结构的另一个视图
索引文件位于公用文件夹中
<link href="css/bootstrap.min.css" rel="stylesheet">
这应该行得通使用以下命令:
@anubhava-ur-way不起作用。请注释您的规则并重新测试。根文件夹(myMVC-folder)中没有index.php文件@SurajMalinga您的index.php文件在哪里?它似乎在公用文件夹中。但实际上它在根文件夹中。我添加了另一个文件结构视图。。