问题描述
(对不起,如果我把这个话题放在一个不正确的类别中)
只是想知道是否可以将页面重定向到另一个URL,如下所示
(sorry, if I put this topic in an incorrect category)
Just wondering if it's possible to redirect page to another URL as like below
我的网络服务器包含3个主文件夹和几个子文件夹
-------------------- -------------------------------
1.文件夹A
sub-folderA1
sub-folderA2
2.文件夹B
sub-folderB1
3.文件夹C
当用户想要转到子文件夹A1时,他们需要输入这个,mydomain。 com / folderA / sub-folderA1
$
他们可以使用这样的快捷方式mydomain.com/sub-folderA1指向mydomain.com/folderA / sub-folderA1
无需创建文件夹" sub-folderA1" (像这样的mydomain.com/sub-folderA1)?
$
我在想什么是...
----- -------------------------------------
第1步:创建。 htaccess文件
步骤2:写一个redirect.aspx页面
步骤3:选择"欲望"基于redirect.aspx的URL
但这不起作用,因为并非所有的网址(我认为它可以但实际上不是)redirect.aspx页面,任何人谁可以给我一些帮助? 无论如何,谢谢。
P.S.我能做的最后一件事就是将所有文件放入
LEVEL 0 所以我网站的每个用户都不需要输入子文件文件夹名称
例如
----------------
子文件夹A1
子文件夹A2
子文件夹B1,
子文件夹C1,
但是这看起来不是很有条理〜
my web server contains 3 main folders and couple sub-folders
---------------------------------------------------
1. folder A
sub-folderA1
sub-folderA2
2. folder B
sub-folderB1
3. folder C
When users want to go to sub-folderA1, they need to type this, mydomain.com/folderA/sub-folderA1
Is is possible for them to have a shortcut like this mydomain.com/sub-folderA1 which is pointing to mydomain.com/folderA/sub-folderA1without the need of creating a folder called "sub-folderA1" (like this mydomain.com/sub-folderA1)?
What I am thinking is
------------------------------------------
Step 1: Create .htaccess file
Step 2: Write a redirect.aspx page
Step 3: Poiting to the "desire" URL based on redirect.aspx
But this doesn't work, as not all URLs going to (I thought it could but actually not) redirect.aspx page, anyone who can give me some help? thanks anyway.
P.S. The final thing I can do is to put all file into LEVEL 0 so every users of my website doesn't need to type sub-folder name
e.g.
----------------
sub-folderA1
sub-folderA2
sub-folderB1
sub-folderC1
but this looks not very organized ~
推荐答案
您可以考虑使用HTTP过滤器拦截传入的请求网址,并根据用户角色重定向到所需的网页。
You can think of using HTTP filters to intercept incoming request url and redirect to desired page based on the user role.
谢谢
Devasaena。
Devasaena.
这篇关于将页面重定向到不同的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!