Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.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 .htaccess重写url don';我做不到_Php_Apache_.htaccess - Fatal编程技术网

Php .htaccess重写url don';我做不到

Php .htaccess重写url don';我做不到,php,apache,.htaccess,Php,Apache,.htaccess,我是htaccess配置的新手,需要您的帮助 我有这个网址: 我不想让你知道 page/web/controller/index.php 请问我该怎么做 这是我的实际访问权限 RewriteEngine on RewriteCond %{HTTP_HOST} ^mypage.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.mypage.com$ RewriteCond %{REQUEST_URI} !mypage/web/ RewriteRule (.*

我是htaccess配置的新手,需要您的帮助

我有这个网址:

我不想让你知道 page/web/controller/index.php

请问我该怎么做

这是我的实际访问权限

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mypage.com$ [NC,OR] 
RewriteCond %{HTTP_HOST} ^www.mypage.com$
RewriteCond %{REQUEST_URI} !mypage/web/
RewriteRule (.*) /page/web/$1 [R=301,L]
RewriteRule ^page/web/(.*)$ $1 [R=301,L,QSA]


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

RewriteRule . index.php
RewriteCond  %{HTTP_HOST} ^mypage.com$[OR]
RewriteCond %{HTTP_HOST}  ^www.mypage.com$
RewriteRule  (.*) "http\:\/\/mypage\.com\/page\/web\/" [R=301,L]

您可以从
http://www.mypage.com/page/web/controller/index.php
http://www.mypage.com
只需添加
标题(“位置:http://www.mypage.com“
。/web/controller/index.php
的顶部,并将index.php添加到根目录,这将重定向到
http://www.mypage.com/index.php

这不是您正在寻找的解决方案,但可能是另一种解决方案。


谢谢:)

您使用的是PHP框架吗?我想要一个漂亮的Url,我不想删除它,我只是不想看到大的Url