![]() |
Mixed Mod_Rewrite with non
ok this is my problem. i hate having to make a new mod rewrite rule everytime i want to add a variable in the url of my websites. i like the way mod rewrite works as it simplify's my visitors browsing and it makes it easier for search engines to find me...
this is what i want. i need a way for my for my pages to use mod rewrite for my components and sub components (act and sub) but then for things like page or article i want to be able to add the old freind ?article= at the end and not have any issues. if you dont get what i mean ill show you below. Code:
i want this: |
Code:
RewriteEngine On |
I think what you want to do is something like this (one of the rewrite rules from sites):
Quote:
Mubs |
The
[QSA] part at the end of my rule does exactly the same only cleaner... |
thank you both very much. i will make sure to try those and hopefully that will save me alot of hassle ^^:-)
|
Just a technical note, the QSA flag appends any query string to the end of the rewritten request in the same way that Mubs' code does. However, a little tweak in the placement of the
%{QUERY_STRNG} variable might be of use (or just a fanciful idea). Consider the following url after rewriting: index.php?section=news&action=recent&<QS> (<QS> is just a placeholder to save space). If the requested url was: /news/recent.html?section=auctions then that request would be rewritten to: index.php?section=news&action=recent§ion=aucti ons (sorry vbulletin inserts a space unnecessarily) which would call the recent action within the auctions section, not news!The tweak to Mubs' rule would be to move the placement of the query string variable: index.php?%{QUERY_STRING}§ion=$1&action=$2This means that even if section and/or action are passed through the query string manually, the "path" versions will always be used. All that said, it's a minor point and you may choose to simply use the QSA flag and accept the 'false' values in the query string. |
| All times are GMT. The time now is 08:40 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0