简体   繁体   English

Silex 和 htaccess 到 /web

[英]Silex and htaccess to /web

I m actually creating a simple application using Silex and I m having some problems.我实际上正在使用 Silex 创建一个简单的应用程序,但我遇到了一些问题。

Actually, I run on an Apache 2 server and I have the fallback /index.php set in my ht access at the root of my application.实际上,我在 Apache 2 服务器上运行,并且在我的应用程序根目录的 ht 访问中设置了后备 /index.php。

In fact, I actually have to get these kind of routes :事实上,我实际上必须获得这些路线:

http://127.0.0.1/appname/web/index.php/route http://127.0.0.1/appname/web/index.php/route

And I need something like我需要类似的东西

http://127.0.0.1/route http://127.0.0.1/route

I absolutely don't know how to proceed...我完全不知道如何继续......

Can you help me a bit ?你能帮我一下吗?

Modify your .htaccess to change your root directory and to replace the index.php.修改您的.htaccess以更改您的根目录并替换 index.php。

RewriteEngine On
RewriteBase /appname/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ %2index.php [QSA]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM