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..
Hello, If you are using cpanel hosting the its very true you get page not found for : articles.example.com/articles/a-title/12 As in cpanel http://example.com/articles/ = http://articles.example.com/ You need not again go to articles after that http://articles.example.com/articales does not exist as per cpanel structure. Just try to access it as http://articles.example.com/a-title/12 You will see it should work.
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?