Au contraire, mon ami! It is possible as the Next flag will run back through to catch the next instance so one Rule to rule them all! However, indeed, the order is important and should be as shown (for the one Rule with Next flag first) followed by the URI move to query string.
Have a look at the tutorial linked in my signature. There are coding examples for (1) capturing the query string and (2) for converting one character to another. THEN, please show us the code you assemble from the examples and I’ll help you get through it.
Just be sure that ScallioXTX’s comments are taken to heart - green-lantern => green+lantern, not lantern => green!
Except for the green/lantern confusion it was perfectly ledgible
Have you taken a look at the article dklynn pointed you to, http://datakoncepts.com/seo and tried something for yourself?
Hello All,
That was a typo from my side - all names will remain the same except for the url and the + and -
Had only 2 hours sleep when I wrote that so am surprised it was actually legible to be honest.
You are on the right track! What you need to do now is replace dashes with pluses. See the section “Replace A Character” in the article on how to do this: http://datakoncepts.com/seo#example-1
Note that AFAIK it’s not possible to replace all dashes with pluses in one RewriteRule, so you’ll need something like
RewriteRule to replace 4 dashes with minuses
RewriteRule to replace 3 dashes with minuses
RewriteRule to replace 2 dashes with minuses
RewriteRule to replace 1 dash with a minus
RewriteRule to replace a URL with 0 dashes
In this example I start with 4, but this depends on your situation. If you also have URLs that have more than 4 dashes you need to make sure you take these into account as well.
So basically what you’re saying is for a URL /some-term-with-dashes-in-it should be rewritten to /search.php?spsp_search=some+term+with+dashes+in+it ?
i.e. for any URL in the root of the website replace the dashes with pluses and feed that as a parameter to /search.php ?
Rémon and I had a chat about this and, when I showed him the code, he got it (he was going at replacing the -'s in the query string which is much more difficult)!
RewriteEngine on
RewriteRule ^/?(.*)-(.*)$ $1+$2 [N,L]
RewriteRule ^([a-z+]+)\\.html$ search.php?spsp_search=$1 [L]
What this does is to replace all -'s with +'s in the {REQUEST_URI} string then match the lowercase letters and +'s.html and send that to the query string as the value of spsp-search.