0

我有一个网站 shop.example.com。我想像这样重写实现:浏览器输入 shop.example.com ----> /shop/index.php(server side) 我这样写规则:

RewriteEngine on  
RewriteCond %{HTTP_HOST} ^shop.example.com [NC] 
RewriteRule ^$ shop/index.php

它不起作用,浏览器什么也没显示。当我像这样更改规则时:

RewriteEngine on  
RewriteCond %{HTTP_HOST} ^shop.example.com [NC] 
RewriteRule ^ssssssssss $ shop/index.php

当浏览器键入 shop.example.com/ssssssssss ----> /shop/index.php 时它确实有效 为什么?我该怎么办?请告诉我!非常感谢!

4

1 回答 1

0

你能试一下吗:

RewriteEngine on  
RewriteCond %{HTTP_HOST} ^shop\.example\.com$ [NC] 
RewriteRule ^/?$ /shop/index.php [L]
于 2013-10-09T17:23:30.097 回答