提前模板Yii2

编程入门 行业动态 更新时间:2024-10-26 06:27:34
本文介绍了提前模板Yii2 - 重定向使用htaccess的,以前端/网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

现在我使用的提前模板Yii2。而使用htaccess的重定向HTTP :: //mydomain到前端/ web文件夹。

Now I am using advance template Yii2. And using htaccess to redirect http:://mydomain to frontend/web folder.

<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} ^/(assets|css|js|ember) RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L] RewriteRule ^css/(.*)$ frontend/web/css/$1 [L] RewriteRule ^js/(.*)$ web/js/$1 [L] RewriteRule ^ember/(.*)$ web/ember/$1 [L] RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css|js|ember)/ RewriteCond %{REQUEST_URI} !index.php RewriteCond %{REQUEST_FILENAME} !-f [OR] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ frontend/web/index.php/$1 [L,QSA] #RewriteRule (.*) frontend/web/$1 [L] </IfModule>

但是当我去到任何URL,即: mydomain/abc 。该网站始终指向首页。即使URL不是invailable ..

but when I go to any url ie : mydomain/abc . the site always point to home page.. Even url not invailable..

在此先感谢

推荐答案

这.htaccess文件对我的作品,你必须把这个.htaccess文件下 yii2advance /前端/ 的根目录,

This .htaccess file works for me, you have to put this .htaccess file under yii2advance/frontend/ root directory,

所以,当你访问的 yii2advance/frontend / 它会改写为 yii2advance/frontend/web

so when you access yii2advance/frontend/ it'll rewrite as yii2advance/frontend/web

RewriteEngine On RewriteBase / RewriteRule ^(.*) frontend/web/index.php/$1 [QSA,L,NC]

更多推荐

提前模板Yii2

本文发布于:2023-11-01 19:52:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550250.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模板

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!