htaccess的子目录的子目录 [英] .htaccess subdirectory to subdirectory

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

问题描述

我已经写了一个web应用程序的企业内部网和我联系不活服务器上的链接导航坐。欢乐。

I've written a web app for an intranet and my links don't sit with the link navigation on the live server. Joy.

我知道你在想什么:写你的该死的应用程序的权利。注意到。

I know what you're thinking : write your damned app right. Noted.

我不知道是否有一个mod_rewrite的/ htaccess的技巧,会从给我..

I'm wondering if there's a mod_rewrite/htaccess trick that would send me from..

/http://example/[admin/generic]/etc/etc2/this_stays_the_same.file

..到..

..to..

/http://example/[src/reports]/etc/etc2/this_stays_the_same.file

..只是将东西方括号中,当我把它放在管理员/通用目录。​​

..just converting the stuff in square brackets, when I place it in the admin/generic directory.

如果有,那将是NEATO。

If there is, that would be neato.

谢谢!

推荐答案

如果你输入的http://例如/ src目录/报告/ ... 在浏览器中,你可以使用一个简单的 重定向

If you enter http://example/src/reports/... into the browser, you can use a simple Redirect

Redirect /src/reports /admin/generic

更新

如果您不希望显示 /管理/通用/...网​​址在浏览器栏,你必须做的改写,而不是重定向

If you don't want to show the /admin/generic/... URL in the browser bar, you must do a rewrite instead of a redirect

RewriteEngine on
RewriteRule ^src/reports/(.*)$ /admin/generic/$1 [L]

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

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