Fixing a bad URL string

Oh, the strange things mod_rewrite does!

Fixing a bad URL string

Postby Koldark » Tue May 23, 2006 12:10 pm

I am not sure how it happened but some podcatchers have inadvertly subscribed to a bad URL. I need to fix that.

The URL is http://theriverbendpodcast.com/feed/?ca ... =index.xml and it should be http://theriverbendpodcast.com/feed/. I have tried various renditions of:

RewriteCond %{QUERY_STRING} ^category_name=index.xml
RewriteRule RewriteRule ^/? http//theriverbendpodcast.com/feed/ [R=301,L]

Either it breaks my whole site or it just doesn't work. What am I doing wrong?
Koldark
 
Posts: 4
Joined: Tue May 23, 2006 12:03 pm

Postby richardk » Tue May 23, 2006 12:18 pm

What am I doing wrong?

You have two RewriteRules on one line, and "^/$" only matches "/", not "feed/" (or "" if it's in the /feed directory).

Try this: (In a .htaccess in the / (root) directory.)
Code: Select all
RewriteEngine On

RewriteCond %{QUERY_STRING} ^category_name=index\.xml$
RewriteRule ^feed/?$ /feed/? [R=301,L]

If you want to put it in the /feed directory, replace "^feed/?$" with "^$".
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Koldark » Tue May 23, 2006 1:37 pm

Thanks for the quick reply. That seemed to have worked.
Koldark
 
Posts: 4
Joined: Tue May 23, 2006 12:03 pm


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 2 guests

cron