Mobile app version of vmapp.org
Login or Join
Reiling115

: Remember that the order of rewrite rules is very important as rule processing stops once a rule is matched. For example, if you first rewrite everything that is not http://www.mysite.com, then

@Reiling115

Remember that the order of rewrite rules is very important as rule processing stops once a rule is matched.

For example, if you first rewrite everything that is not www.mysite.com, then you will never match something.mysite.com later on because the host has already been rewritten. In this case, you would want to rewrite your feed url's first, and rewrite your traffic to www.mysite.com in a rule later on.

Rewrite rules can be extremely tedious and cryptic and will just take some time to figure out (it is well worth the effort!).

To start, enable rewrite logging so you can see what is happening:

RewriteEngine On
RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 9


RewriteLogLevel is a 0-9 value, with 9 being debug. Be sure to turn this off on production:

### I just comment them out when not in use ### #RewriteEngine On #RewriteLog "/var/log/apache2/rewrite.log" #RewriteLogLevel 9


You will need to reload your apache once you have enabled or disabled logging: /etc/init.d/apache2 reload for example.

I then usually open a new terminal and tail -f /var/log/apache2/rewrite.log while I am debugging.

Of course, never play with rewrites on a production system as it is extremely easy to bring things to a halt ;)

Hope this helps!

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Reiling115

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme