Url redirect via .htaccess


#1

Hi - I’m trying to forward the rss feed from an old install of my site, and it’s not working.

The current feed is:

http://www.stepintomythimble.com/wordpress/?feed=rss2

and I want to redirect to:

http://www.stepintomythimble.com/wp/?feed=rss2

This is what I have in the .htaccess file, which is in the root folder:

301 Redirect /wordpress/?feed=rss2/ /wp/?feed=rss2

Should this say something different?

Thanks for any help!


#2

Yes.

Apache doesn’t match query string parameters with this directive. You would need to use mod_rewrite, something like:

RewriteBase /
RewriteCond {%QUERY_STRING} ^feed=rss2$
RewriteRule wordpress http://www.stepintomythimble.com/wp/?feed=rss2 [L]
+
That’s untested.


#3

okay. so I tried this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^stepintomythimble.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.stepintomythimble.com$
RewriteRule ^wordpress/?feed=rss2 “http://stepintomythimble.com/wp/?feed=rss2” [R=301,L]

and it didn’t work. this specific code has worked for me on other servers - is this a dreamhost specific issue? or am I still writing something wrong?

Thanks,
Carrie

[hr]
Never mind - this worked. the file was named incorrectly (there was a space before the . in .htaccess. STUPID.)

thanks for your help!


#4

Okay, I thought it was working but it’s not. can you take a look at this and maybe let me know what should be changed? I messaged tech support and they said to post in the forums.

Here’s what I’ve got:

ErrorDocument 404 /wp/index.php?error=404

BEGIN WordPress

Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^stepintomythimble\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.stepintomythimble\.com$ RewriteRule ^wordpress\/\?feed\=rss2 http\:\/\/stepintomythimble\.com\/wp\/\?feed\=rss2 [R=301,L] # END WordPress ----------------------