Forum Moderators: phranque
I was wondering if someone could point out whether something really obvious is wrong with this rule:
RewriteEngine On
RewriteBase /
RewriteRule ^(.*) /index.php?a=$1 [L]
The idea would be that sub.abc.com/test would = sub.abc.com/index.php?a=test
Seems simple enough to me and looks like it should work, but when I launch it my browser just sits on a blank page loading. This is not the worst though, my biggest problem is that I notice with "top" (*nix prog) that apache keeps spawning more and more copies, as if the ReWriteRule is getting stuck in an infinite loop.
The help I therefore require is just some confirmation that I haven't done something really stupid in the above rules which might be causing this to happen.
Apache crashing is not good for my health, the first time it happend, after a restart of my box mysql would no longer load. I had to reinstall mysql, but not after having to also apt-get install coreutils as my df (the prog which shows disk space) was mis-reporting free space as a negative number and stopping mysql from being reinstalled.
On a similar subject, has anyone ever written any simple Windows apps that you can test ReWriteRules with. Eg, you have a blank screen which you enter your rules into and then the desired web address and it displays the outcome URL. This would be a really great app, and one I would definately use, especially as you could have step through debugging and such.
Anyway thanks for any help, and cheers for such a great forum.
Fuzzup.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !index\.php
RewriteRule ^(.*) /index.php?a=$1 [L]
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} !a=
RewriteRule ^(.*) /index.php?a=$1 [L]
Don't forget to add a space after the }
[edited by: jdMorgan at 5:02 pm (utc) on Jan. 29, 2005]
[edit reason] Added persistent space using bold tags. [/edit]