目录结构
web
- bar
- index.php //вы в bar
- .htaccess
- foo
- index.php // вы в foo
- .htaccess
如何制作 htaccess 以便在请求 bar/page 时启动来自 foo 的 index.php?
这个选项:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/(page)
RewriteRule ^page(\/?.*)$ ../foo/index.php$1 [L]
说:未找到 在此服务器上未找到请求的 URL /bar/page/。
这样的:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/(page)
RewriteRule ^page(\/?.*)$ ../foo/$1 [L]
在栏中打开同一页面
在 .htaccess 中,它应该位于根目录(在 web 目录中):
如果您有权访问 Apache 配置,那么您可以为以下站点执行此操作
bar:回答: