【问题标题】:.htaccess mod_rewrite pretty URLs with subdomain.htaccess mod_rewrite 带有子域的漂亮 URL
【发布时间】:2012-05-28 10:29:27
【问题描述】:

我正在尝试从中获取我的网址:

hxxp://m.newsite.com/index.php?id=12345

到这里:

hxxp://m.newsite.com/12345

我遇到的麻烦是我有一个共享主机帐户并且我正在托管一个新域,因此从技术上可以从以下网址访问带有子域的上述 URL:

hxxp://www.originalsite.com/newsite.com/mobile

我已经为 mod_rewrite 尝试了各种不同的组合,但恐怕我就是不存在!救命!

【问题讨论】:

    标签: .htaccess mod-rewrite subdomain friendly-url


    【解决方案1】:

    把这个放在/newsite.com/mobile目录的htaccess中

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^m\.newsite\.com$
    RewriteRule ^([0-9]+)$ index.php?id=$1 [L]
    

    【讨论】:

      猜你喜欢
      • 2010-11-01
      • 2011-03-09
      • 2014-09-24
      • 1970-01-01
      • 2018-04-06
      • 2012-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多