Forum Moderators: phranque
RewriteCond %{QUERY_STRING} ^feed=podcast$
RewriteRule ^$ http\:\/\/www\.example\.com\/feed\/podcast\? [R=301,L]
Am I close?
Correct. I do have "RewriteEngine on".
and any other lines necessary for mod_rewrite.
So, we can assume .htaccess/mod_rewrite is good to go?
RewriteEngine on
RewriteCond %{QUERY_STRING} ^feed=podcast$
RewriteRule ^$ http://www.example.com/feed/podcast? [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^feed\=podcast$ "http\:\/\/www\.example\.com\/feed\/podcast" [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^feed$ "http\:\/\/example\.com\/feed\/podcast" [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I don't see a .htaccess/mod_rewrite ...
http://www.example.com/?feed=podcast ...but my other 301 redirects are working.
RewriteRule foobar http://www.example.com/widget.html [R=301,L]
AND, in the WordPress block, add this line before the -f condition: RewriteCond %{REQUEST_URI} !widget
Where I've said "foobar" and "widget", use any two made-up names that don't really exist on your site. Now try requesting /foobar.html (or anything with "foobar" in the name). If the rule works, you will end up on a 404 page, and the browser's address bar will say /widget.html In particular: the URL example.com/feed/podcast doesn't correspond to a real, physical file, does it?
Does "other 301 redirects" mean redirects using mod_alias (Redirect or RedirectMatch by that name)?
I'm not too sure.
It appears that the .htaccess file is automatically updated when I make the changes in the GUI (cpanel).
Is it something beginning in RewriteRule, or something beginning in Redirect(Match)?
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^feed\=podcast$ "http\:\/\/www\.example\.com\/feed\/podcast" [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^feed$ "http\:\/\/example\.com\/feed\/podcast" [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
rather than simply RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$
RewriteCond %{HTTP_HOST} example\.com
and omitting even this line if there's only one site on the account. Both of these RewriteRules were created in the cpanel: