Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.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 mod_rewrite是否在不更改浏览器中url的情况下重定向?_Php_Apache_.htaccess_Mod Rewrite_Redirect - Fatal编程技术网

Php mod_rewrite是否在不更改浏览器中url的情况下重定向?

Php mod_rewrite是否在不更改浏览器中url的情况下重定向?,php,apache,.htaccess,mod-rewrite,redirect,Php,Apache,.htaccess,Mod Rewrite,Redirect,现场的总体结构为: 后端 -特拉拉拉 -特拉拉拉 -万维网 ----index.php 前端 -特拉拉拉 -特拉拉拉 -万维网 ----index.php 常见的 -特拉拉拉 .htaccess 域名egwww.mysite.com 我可以做些什么来注册.htaccess,这样当你进入www.mysite.com处理文件frontend/www/index.php,然后显示urlwww.mysite.com?例如,如果编写www.mysite.com/admin/,那么要处理文件backend

现场的总体结构为:

后端
-特拉拉拉
-特拉拉拉
-万维网
----index.php
前端
-特拉拉拉
-特拉拉拉
-万维网
----index.php
常见的
-特拉拉拉
.htaccess
域名eg
www.mysite.com

我可以做些什么来注册
.htaccess
,这样当你进入
www.mysite.com
处理文件
frontend/www/index.php
,然后显示url
www.mysite.com
?例如,如果编写
www.mysite.com/admin/
,那么要处理文件
backend/www/index.php


在这种情况下,所有选项都可能是其他选项,例如
www.mysite.com/game/gta/
(而不是
game/gta/
),在这种情况下,为了用以下参数标记文件
frontend/www/index.php
(获取类型)
type=game&name=gta

尝试在htaccess文件中使用以下规则:

RewriteEngine On

RewriteCond %{REQUEST_URI} ^/admin/
RewriteRule ^ /backend/www/index.php [L]

RewriteCond %{REQUEST_URI} !^/(frontend|backend|common)
RewriteRule ^ /frontend/www/index.php

谢谢,非常有帮助。