htaccess的重定向 [英] Htaccess redirect

查看:115
本文介绍了htaccess的重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要共享宿主服务器上安装的Symfony型网站。我可以写入/ WWW /只。

问题是,Symfony的将是/ www /网络/;有没有一种方法,以服务

  www.example.com/web/index.php/something
 

当用户问:

  www.example.com/index.php/something
 

解决方案

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

  RewriteEngine叙述上
重写规则!^网站/网页%{REQUEST_URI}
 

这将prePEND /网络来的每个请求的路径已不下手 / WEB /

I'm trying to install a Symfony based website on a shared hosting server. I can write into /www/ only.

The problem is that Symfony will be in /www/web/ ; Is there a way to serve

www.example.com/web/index.php/something

when users ask for :

www.example.com/index.php/something

解决方案

Try this rule in the .htaccess file in the document root directory:

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

This will prepend /web to every request that’s path does not already start with /web/.

这篇关于htaccess的重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆