的.htaccess重定向到子文件夹(屏蔽) [英] .htaccess redirection to subfolder (masked)

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

问题描述

我要重定向www.adomain.com到www.adomain.com/cms。 CMS的部分应该屏蔽。

我不明白它的工作默默。因此,CMS始终是URL的一部分。

我想这个解决方案: http://stackoverflow.com/a/4475173/1052107 的,但我总能得到内部服务器错误。

解决方案

  RewriteEngine叙述上
的RewriteBase /
重写规则^(。*)$ /文件夹/ $ 1
 

和本应在域的根走在.htaccess文件。

这是被拉断一个网站我现在已经这样做,所以它应该工作

I want to redirect "www.adomain.com" to "www.adomain.com/cms". The cms-part should be masked.

I don't get it to work silently. So "cms" is always part of the url.

I tried this solution: http://stackoverflow.com/a/4475173/1052107, but I always get an Internal Server Error.

解决方案

RewriteEngine on
RewriteBase /
RewriteRule ^(.*)$ /folder/$1

And this should go in the .htaccess file at the root of the domain.

This is pulled off a site I have doing this now, so it should work

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

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