简体   繁体   English

如何将URL重定向到根文件夹

[英]how to redirect url to root folder

I need to access root folder from web url 我需要从网址访问根文件夹

my domain is for example : https://myname.com 我的域名例如: https : //myname.com

i have few files under root i am using ubuntu 我在root下有几个文件,我正在使用ubuntu

example(folder name in root location) : pod 示例(根目录中的文件夹名称):pod

i need to access this root folder https://myname.com/pod/ 我需要访问此根文件夹https://myname.com/pod/

please help me how to do this 请帮我怎么做

i created folder "pod" in my var/www/html/ and tried to redirect to root folder pod but it didn't work 我在var / www / html /中创建了文件夹“ pod”,并尝试重定向到根文件夹pod,但是它不起作用

i tried the followed way 我尝试了以下方式

sudo Redirect permanent /pod/ https://myname.net/pod/
sudo: Redirect: command not found

Rewrite rule cannot be run using sudo . 不能使用sudo运行重写规则。

Place this rule in /var/www/html/pod/.htaccess 将此规则放在/var/www/html/pod/.htaccess

RedirecetMatch 301 ^ /

Then try visiting http://example.com/pod/ 然后尝试访问http://example.com/pod/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM