Php htaccess在子目录[Apache 2.2.27]中获取子域
我的服务器上有一个动态子域设置,带有 .example.com=>example.com/page.php?pageDetailId=[] 我的.htaccess:Php htaccess在子目录[Apache 2.2.27]中获取子域,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,我的服务器上有一个动态子域设置,带有 .example.com=>example.com/page.php?pageDetailId=[] 我的.htaccess: 通过在子目录student中添加一个.htaccess来解决此问题,如下所示: <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} !^([w]{3,3}[.]{1,
通过在子目录student中添加一个.htaccess来解决此问题,如下所示:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^([w]{3,3}[.]{1,1}){0,1}arcanemind.com$
RewriteCond %{HTTP_HOST} ^([0-9a-zA-Z-]*)[.]arcanemind.com$
RewriteRule ^MyCourse.php$ MyCourse.php?pageDetailId=%1 [L]
</IfModule>
不过,如果有人能够使用regex并在子目录中的所有文件中传递变量,我将不胜感激
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^([w]{3,3}[.]{1,1}){0,1}example.com$
RewriteCond %{HTTP_HOST} ^([0-9a-zA-Z-]*)[.]example.com$
RewriteRule ^$ page.php?pageDetailId=%1 [NC,L]
RewriteCond %{HTTP_HOST} !^([w]{3,3}[.]{1,1}){0,1}example.com$
RewriteCond %{HTTP_HOST} ^([0-9a-zA-Z-]*)[.]example.com$
RewriteRule ^/student/MyCourse.php$ /student/MyCourse.php?pageDetailId=gateonline [NC,L]
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^([w]{3,3}[.]{1,1}){0,1}arcanemind.com$
RewriteCond %{HTTP_HOST} ^([0-9a-zA-Z-]*)[.]arcanemind.com$
RewriteRule ^MyCourse.php$ MyCourse.php?pageDetailId=%1 [L]
</IfModule>