: 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
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!
More posts by @Reiling115
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.