Forum Moderators: phranque
RewriteRule ^feeds/custom\.(rss¦atom)?q=(.*)$/feeds/custom.php?mode=$1&q=$2 [NC]
Normally I'm good at these rewrite rules, but this one isn't working.
If you try to access the file directly, for example: /feeds/custom.php?mode=rss&q=query it works just fine, but /feeds/custom.rss?q=query isn't being rewritten.
I think it might have something to do with ?q= in it, so I've tried something like
RewriteRule ^feeds/custom\.(rss¦atom)\?q=(.*)$/feeds/custom.php?mode=$1&q=$2 [NC]
But that didn't work either.
Any help is much appreciated.
RewriteCond %{QUERY_STRING} ^q=(.*)$
RewriteRule ^feeds/custom\.(rss¦atom)$ /feeds/custom.php?mode=$1&q=%1 [NC]
More information is available in the on-line Apache mod_rewrite documentation.
Change the broken pipe "¦" character above to a solid pipe character before use; Posting on this forum modifies the pipe characters.
Jim
I had no idea that RewriteRule didn't affect query strings, this is the first time I ever used them with that. I thought my error had something to do with not escaping the question mark or the equals sign.
As far as my top post being three parts, not four, apparently my tab in between the two middle parts got stripped out when I posted.
Thanks again everyone!