Php htaccess-我更改了重写库,但仍然需要url中的公用文件夹

Php htaccess-我更改了重写库,但仍然需要url中的公用文件夹,php,.htaccess,Php,.htaccess,我的index.php在公共文件夹中,在.htaccess文件中,我说rewrite base是公共目录。但是当我打开cms.test时,它会给我cms文件夹。。对于使用索引php,我仍然需要转到公用文件夹 这是我的.htaccess文件 Options -MultiViews RewriteEngine On RewriteBase /var/www/cms/public RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_F

我的index.php在公共文件夹中,在.htaccess文件中,我说rewrite base是公共目录。但是当我打开cms.test时,它会给我cms文件夹。。对于使用索引php,我仍然需要转到公用文件夹

这是我的.htaccess文件

Options -MultiViews
RewriteEngine On

RewriteBase /var/www/cms/public

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.+)$ index.php?url=$1 [QSA]

如何修复此问题?

将公用文件夹设置为根目录

Options -MultiViews
RewriteEngine On

RewriteBase /var/www/cms/public

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.+)$ index.php?url=$1 [QSA]

将您的公用文件夹设置为根目录

您的答案与他们所说的不同吗?实际上它不是根目录,它只是根目录中的另一个文件夹。我检查了其他mvc frameoworks,它们如何将http请求重定向到index.php,但据我所知,它们使用sample server.php来实现这一点。。我只是想知道有没有可能在没有任何服务器的情况下将请求直接重定向到index.phpfile@tereško它基于mvc系统实际上,你确定它没有与mvc标签绑定吗?它是关于URL路由和htaccess的。这与MVC无关。你在上面运行的也是基于C的。那么为什么你不在上面加上C的标签呢?可能还有MySQL。
Options -MultiViews
RewriteEngine On

RewriteBase /var/www/cms/public

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.+)$ index.php?url=$1 [QSA]