mod_rewrite problem with subdomain..

Discussion in 'Apache' started by vvenomouss, Mar 16, 2009.

  1. #1
    I am having a problem with mod_rewrite on subdomains..

    I have a folder named 'articles' and have a .htaccess inside this foler that rewrites as:
    
    <IfModule mod_rewrite.c>
       RewriteEngine On
    RewriteRule ^/?/(.*)/([0-9]+)$ ../example.php?id=$3 [L]
    </IfModule>
    
    Code (markup):
    now when i access example.com/articles/a-title/12 it works fine...
    I created a subdomain articles.example.com & when I access articles.example.com/articles/a-title/12 the server returns a 400 bad request error...

    All my other rules work too without subdomain but with subdomain none works even simply opening articles.example.com returns a 400 error.. can someone please provide some assistance..
     
    vvenomouss, Mar 16, 2009 IP
  2. webhost.uk.net

    webhost.uk.net Well-Known Member

    Messages:
    296
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    128
    #2
    webhost.uk.net, Mar 16, 2009 IP
  3. vvenomouss

    vvenomouss Peon

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hi.. thnx for da post.. i am using cpanel and i know articles.example.com = example.com/articles so im not doing as:

    articles.example.com/articles, im using articles.example.com/a-title/45 and i do not get a 404 error, i am getting a 400 bad request error when using subdomains though directly accessing the directory example.com/articles/a-title/45 works perfectly.. any ideas? :confused:
     
    vvenomouss, Mar 17, 2009 IP