Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
.htaccess Htaccess重定向_.htaccess_Redirect - Fatal编程技术网

.htaccess Htaccess重定向

.htaccess Htaccess重定向,.htaccess,redirect,.htaccess,Redirect,我正在尝试在共享托管服务器上安装一个基于Symfony的网站。我只能在/www/上写字 问题是Symfony将位于/www/web/;有什么方法可以服务吗 www.example.com/web/index.php/something 当用户要求: www.example.com/index.php/something 在文档根目录的.htaccess文件中尝试此规则: RewriteEngine on RewriteRule !^web/ web%{REQUEST_URI} 这将在路径尚

我正在尝试在共享托管服务器上安装一个基于Symfony的网站。我只能在/www/上写字

问题是Symfony将位于/www/web/;有什么方法可以服务吗

www.example.com/web/index.php/something
当用户要求:

www.example.com/index.php/something

在文档根目录的.htaccess文件中尝试此规则:

RewriteEngine on
RewriteRule !^web/ web%{REQUEST_URI}

这将在路径尚未以
/web/

开头的每个请求前添加
/web
,这是可行的,但是否仍然可以不将“/web/”添加到url?我正在使用symfony重做我的网站,我希望有与以前相同的URL,以保持我的pagerank。@Manu:此规则不应导致外部重定向。你是否使用了其他可能导致这种情况的规则?@Manu:看看是什么导致了这种外部重定向。哇,我认为我无法在服务器services/web/index.html上访问它,但重写了url,因为我只有一个htaccess文件,可能服务器的配置很奇怪。
RewriteEngine on
RewriteRule !^web/ web%{REQUEST_URI}