简体   繁体   中英

View folder instead of public_html

How can i "redirect" my page, to show /v4-beta/ instead of ./ when accesing my domain?

Not only redirect but show the content of v4-beta on the domain and not www.domain.com/v4-beta ? but showing www.domain.com but all content is from v4-beta ?

A simple solution would be to include the subfolder's index file in the top-level index file.

public_html/index.php:

<?php
include("v4-beta/index.php");
?>

You are looking for the rewriting module that comes with the apache http server:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/v4-beta/
RewriteRule ^(.*)$ /v4-beta/$1 [L]

The module has to be loaded first. Then you can use those commands inside the mail server configuration or inside so called .htaccess files. The frist option is the preferred one.

Htaccess :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteCond %{REQUEST_URI} !^/v4-beta/
RewriteRule (.*) /v4-beta/$1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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