It has been done in the GT-NExtGEn already, but I will explain it a bit here.
The most important part is the source code of the file because it contains the URL's we wish to tap, if you grab a URL from the search module like the one below, we will tap it together. This is our URL
From there we substitute the variables with their proper regex expressions, those would happen to be this:
Code:
([a-z]*) <--lower case only
([a-zA-Z]*) <-- Upper and lower case
([0-9]*) <--Numbers only
([a-zA-Z0-9]*) upper, lower, and numbers
Special characters if needed can be put in the end like this, beware that punctuation will need to be followed like a backslash
([a-zA-Z0-9=\;\,\.\?\!=_-]*)
Now that we know what the regex's are for the variables, we replace our variables with those regex's
The first portion of the header.php is complete, now we must complete the $urlout array, note that these have to match, so if the above statement is the fifth down in your list, the $urlout match must be the fifth down as well. Lets make the match this:
Code:
"search-\\1-\\2.html",
The \\1 indicates the first group which is ([a-zA-Z0-9_-]*) and equal to that of the query.
The \\2 indicates the second group which is ([0-9]*) and equal to that of $topic
From here we must build our .htaccess statement, this is easy as we have already done all the work.
The $1 and $2 are the same as the \\1 and \\2 above, they are used as groups, the $1 substitutes the contents of ([a-zA-Z0-9_-]*) and the $2 is for the contents of ([0-9]*). When you click search-blah-1.html it takes that URL and plugs it into the search-([a-zA-Z0-9_-]*)-([0-9]*).html portion if it fits (which it does), it then takes those matching values and put them in the longer URL and executes that behind the scenes. Hope some of this made sense, that is how it basically works. Those regex above can be used on most variables, if you go to gt.audioslaved.com you will see the search should be fully tapped, feel free to test the beta 0.2 and see if this is what you are looking for.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum