Help with basic .htaccess mod_rewrite

前端 未结 2 1626
春和景丽
春和景丽 2021-01-28 04:32

I am currently interpreting sub-domain wild-cards with php and i would like to handle them with .htaccess, user profiles will be accessed at http://username.mysite.com/ (or for

相关标签:
2条回答
  • 2021-01-28 04:42

    Try:

     RewriteRule ^error/(.*) index.php?error=$1 [L]
     RewriteRule ^file/(.*) index.php?file=$1 [L]
    

    ... for the last two.

    0 讨论(0)
  • 2021-01-28 04:54

    Try this:

    # stop rewriting for the host names example.com and www.example.com
    RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$
    RewriteRule ^ - [L]
    
    RewriteRule ^error/(.*) index.php?error=$1 [L]
    RewriteRule ^file/(.*) index.php?file=$1 [L]
    
    0 讨论(0)
提交回复
热议问题