Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


boostr.in questions - Question:htaccess - Why aren't my rewrite rules working?


There's some misconfiguration in my htaccess which I can't solve :/

Here's the htaccess:

RewriteEngine on
RewriteRule ^([^\.]+)/?$ index.php?page=$1

rewritecond %{http_host} ^domain.com [NC]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,L]
The .htaccess actually works fine, except in one case: When I connect to a subpage to the root domain without "www.", like this:

http://domain.com/somestuff
Then the first rule doesn't apply and I get redirected to:

http://www.domain.com/index.php?page=somestuff
What have I done wrong?? Thanks for any suggestions!

asked Sep 13, 2013 in htaccess by rajesh
edited Sep 12, 2013
0 votes
10 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...