简体   繁体   English

显示文件夹以替换我的域

[英]Display folder for replace my domain

Hi i have a url like aaa.com/folder but its possible to directly display just aaa.com ? 嗨,我有一个类似aaa.com/folder的URL,但它可能直接显示为aaa.com吗?

I have already test this in htaccess 我已经在htaccess中测试了

   <VirtualHost *:80> 
ServerAdmin webmaster@siteprincipal.com 
DocumentRoot /public_html/porn
ServerName www.siteprincipal.com 
ServerAlias siteprincipal.com 
CustomLog logs/principal-access_log combined 
ScriptAlias /cgi-bin/ /home/principal/cgi-bin/ 
AddHandler x-httpd-php5 .php 
</VirtualHost> 

Hi i have a url like aaa.com/folder but its possible to directly display just aaa.com ? 嗨,我有一个类似aaa.com/folder的URL,但它可能直接显示为aaa.com吗?

First, get rid of what stuff in your htaccess. 首先,摆脱htaccess中的内容。 None of that stuff belongs in the htaccess file, they all belong in your server's vhost config. 这些东西都不属于htaccess文件,它们都属于服务器的vhost配置。

You need to make sure mod_rewrite is turned on, then just add in your htaccess: 您需要确保已打开mod_rewrite,然后只需添加htaccess:

RewriteEngine On
RewriteCond ^(?!folder/) /folder%{REQUEST_URI} [L]

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

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