Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess .htc访问两个子目录_.htaccess - Fatal编程技术网

.htaccess .htc访问两个子目录

.htaccess .htc访问两个子目录,.htaccess,.htaccess,我正在尝试使用.htaccess控制访问我的网站。我有两个网站:一个是wordpress博客,另一个是mydomain.com/wordpress和mydomain.com/wiki 我希望我的域能够访问/wordpress,而不在http地址栏中显示它。(wordpress配置正确) wiki站点应该只显示在/wiki下 我尝试了很多解决方案(也在stackoverflow上),但到目前为止都没有效果 RewriteEngine On RewriteBase /mydomain.com/ #

我正在尝试使用.htaccess控制访问我的网站。我有两个网站:一个是wordpress博客,另一个是mydomain.com/wordpress和mydomain.com/wiki

我希望我的域能够访问/wordpress,而不在http地址栏中显示它。(wordpress配置正确)

wiki站点应该只显示在/wiki下

我尝试了很多解决方案(也在stackoverflow上),但到目前为止都没有效果

RewriteEngine On
RewriteBase /mydomain.com/

# WIKI
RewriteCond %{REQUEST_FILENAME} !-f    # Existing File
RewriteCond %{REQUEST_FILENAME} !-d    # Existing Directory
RewriteRule ^wiki/(.*)$ wiki/index.php?title=$1 [L,QSA]

# WORDPRESS
# RewriteCond %{REQUEST_FILENAME} !-f    # Existing File
# RewriteCond %{REQUEST_FILENAME} !-d    # Existing Directory
# RewriteRule ^/*$ /wordpress/index.php [L,QSA]
编辑

www.mydomain.com -> www.mydomain.com/wordpress
www.mydomain.com/wiki/(.*)$ -> www.mydomain.com/wiki/index.php?title=$1

简单的回答-你不能这样做,因为,假设你有一个指向


http://www.yourdoamain.com/index.php
-你希望你的apache在维基或博客上出现什么

简单的回答-你不能这样做,因为,假设你有一个指向


http://www.yourdoamain.com/index.php
-你希望你的apache在维基或博客上出现什么

这个决定是基于什么?当两个应用程序中都存在相同的文件时会发生什么情况?-您将提供哪一个?我将提供/wordpress/index.php,因为regex^wiki/(*)与任何内容都不匹配。更清楚地说:哦,是的,但是,你不能先在htdocs中安装wordpress,然后在安装的子目录中安装wiki吗?它应该能正常工作……也许对WordPress的
.htaccess
进行了一些修改,那么这个决定是基于什么?当两个应用程序中都存在相同的文件时会发生什么情况?-您将提供哪一个?我将提供/wordpress/index.php,因为regex^wiki/(*)与任何内容都不匹配。更清楚地说:哦,是的,但是,你不能先在htdocs中安装wordpress,然后在安装的子目录中安装wiki吗?它应该可以正常工作……也许在wordpress的
.htaccess
中做一些修改