文件夹结构:
web
- bar
- index.php // echo 'you are inside bar'
- .htaccess
- foo
- index.php // echo 'you are inside foo'
- .htaccess
我必须写在.htaccess栏中,请求栏/页面从foo文件夹中启动index.php?
答案 0 :(得分:1)
您可以在bar/.htaccess
:
RewriteEngine On
RewriteRule ^page(/.*)?$ /foo/index.php [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]