【发布时间】:2014-01-16 05:15:20
【问题描述】:
我有一个在自定义框架上运行的网站。但是我想添加一个网关子域来处理特定的请求。以及处理 api 请求的 api 子域。
现在有一个复杂的文件夹结构:
-application
-config
-subs (subdomain folder)
- gateway
- api
-library
-public
.htaccess [2]
-scripts
-tmp
.htaccess [1]
现在我想让http://gateway.example.com 重定向到 subs > 网关,并将 http://api.example.com 重定向到 subs > api 文件夹。
第一个.htaccess [1]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/scripts/
RewriteRule ^(.*)$ /public/$1 [L]
</IfModule>
第二个 .htaccess [2] (我认为不需要在这里发布,但你更新了;)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^popup/ - [L]
RewriteRule ^img/ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$0 [PT,L]
</IfModule>
我认为我应该更改第一个 .htaccess [1]。但是为了什么?
请帮帮我。
【问题讨论】:
标签: apache .htaccess mod-rewrite redirect