我在同一托管中有2个域,在文件夹public_html内部保留文件夹和index.php来自域principtal和public_html内部的其他文件夹,其中含有名称为“ domain2.com”的文件夹。 =“ http://www.domain2.com” rel =“ nofollow noreferrer”> www.domain2.com
实际上,如果输入到 www.domain1.com 或 www.domain2.com 如果我功能完美,但是如果我需要输入 www.domain2.com/folder2 不要在文件夹中inter infolder2 域这样的域 www.domain2.com/domain2.com/domain2.com/whereber 和这种方式工作
我的问题是如何修改.htacces文件,以便输入它仅显示地址 www.domain2.com/folder
我在HTACCESS中的代码
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA]
RewriteCond %{HTTP_HOST} ^(www.)?domain1.com.ar$
RewriteCond %{REQUEST_URI} !^/domain1.com.ar/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /domain1.com.ar/$1
RewriteCond %{HTTP_HOST} ^(www.)?domain2.com.ar$
RewriteRule ^(/)?$ domain2.com.ar/index.php [L]
</IfModule>
目前使用带有PHP 5.6的共享托管,
非常感谢您,请原谅我的英语
I have 2 domains in the same hosting, inside the folder public_html stay the folders and the index.php from the domain principal and inside the public_html have other folder with the name "domain2.com" where have the index.php from www.domain2.com
Actually if enter to www.domain1.com or www.domain2.com function perfectly but if i need enter in www.domain2.com/folder2 dont work for enter in folder "folder2" need put the domain this way www.domain2.com/domain2.com/whereber and this way works
My question is how do I modify the .htacces file so that when entering www.domain2.com/domain2.com/folder2 it only shows the address www.domain2.com/folder
This is my code in htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA]
RewriteCond %{HTTP_HOST} ^(www.)?domain1.com.ar$
RewriteCond %{REQUEST_URI} !^/domain1.com.ar/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /domain1.com.ar/$1
RewriteCond %{HTTP_HOST} ^(www.)?domain2.com.ar$
RewriteRule ^(/)?$ domain2.com.ar/index.php [L]
</IfModule>
I currently use a shared hosting with php 5.6
Thank you very much and excuse my english
发布评论
评论(1)
您的问题似乎在您网站的根目录配置中。
基本上,现在意味着您的网站文件位于服务器的
root/domain2.com/
中。简而言之,您的域连接到一个根文件夹,该文件夹包含另一个称为
domain2.com
的文件夹,看起来像domain2.com
包含您的站点文件。因此,为了解决此问题,请尝试在服务器中找到文件夹
domain2.com
,然后将所有文件从domain2.com
移动到文件夹中,其中domain2.com 已找到。
您能指定您正在使用的服务器吗?您是否使用共享托管,例如 cpanel 或 plesk ,或者您使用的是vps/deticic of vps/dettic of iis Windows Server ?
Your issue seems to be in your site's root directory configuration.
Basically now it means that your site's files are located in server's
root/domain2.com/
.In a simple words, your domain is connected to a root folder which contains another folder called
domain2.com
and looks likedomain2.com
contains your site files.So in order to fix this, try to locate folder
domain2.com
in your server and move all files fromdomain2.com
to folder wheredomain2.com
was located.Could you please specify what server are you using? Are you using shared hosting like cPanel or Plesk or you are using vps/dedicated like iis windows server?