Everton
Member
Posted 5 years ago #
Hi
I'm trying to use .htaccess to redirect old urls on my old blog to my new WP blog e.g. need to get http://www.connectedinternet.co.uk/blog/_archives/2005/10/18/1307475.html to redirect to http://www.connectedinternet.co.uk/2005/10/18/ (at least it's to the right day). Can someone tell me what is wrong with my .htacesss file please.
thanks
Everton
----------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/blog/_archives/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)\.html$ http://connectedinternet.co.uk/$1/$2/$3/ [QSA,L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect FeedBurner to your own Feed
RewriteBase /
RewriteRule ^feedburner_929946/?$ /feed/ [R,L]
RewriteCond %{HTTP_USER_AGENT} ^FeedBurner.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# These Rules redirect all feed Traffic to FeedBurner
RewriteBase /
RewriteCond %{QUERY_STRING} ^feed=(feed|rdf|rss|rss2|atom)$
RewriteRule ^(.*)$ http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [R,L]
RewriteRule ^(feed|rdf|rss|rss2|atom)/?(feed|rdf|rss|rss2|atom)?/?$ http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [R,L]
RewriteRule ^wp-(feed|rdf|rss|rss2|atom).php http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [R,L]
# These are the standard WordPress Rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Try updating
RewriteRule ^/blog/_archives/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+).html$
to
RewriteRule ^blog/_archives/([0-9]{4})/([0-9]{2})/([0-9]{2})/([0-9]{7}).html$
Also, if you're using a modern version of WordPress, its RewriteRules now look like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Everton
Member
Posted 5 years ago #
Hi
thanks for trying to help - still no joy. Here's how things stand currently:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirect FeedBurner to your own Feed
RewriteRule ^blog/_archives/^([0-9]{4})/^([0-9]{2})/^([0-9]{2})/^([0-9]{6,7}).html$ /$1/$2/$3/ [QSA,L]
RewriteRule ^feedburner_929946/?$ /feed/ [R,L]
RewriteCond %{HTTP_USER_AGENT} ^FeedBurner.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# These Rules redirect all feed Traffic to FeedBurner
RewriteCond %{QUERY_STRING} ^feed=(feed|rdf|rss|rss2|atom)$
RewriteRule ^(.*)$ http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [R,L]
RewriteRule ^(feed|rdf|rss|rss2|atom)/?(feed|rdf|rss|rss2|atom)?/?$ http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [R,L]
RewriteRule ^wp-(feed|rdf|rss|rss2|atom).php http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [R,L]
# These are the standard WordPress Rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
This is really starting to bug me - any ideas anyone?
Everton
Member
Posted 5 years ago #
I'm still making no progress - can anyone help?
SteveandDawn
Member
Posted 5 years ago #
Try looking at this thread and see if it helps. Good luck.
http://wordpress.org/support/topic/69983
Everton
Member
Posted 5 years ago #
Hi
I found this thread and it solved all my problems in 2 mins. If anyone needs a CLEAR guide to .htaccess read this post.
http://forums.digitalpoint.com/showthread.php?t=23044
AskApache
Member
Posted 5 years ago #
Hi
I'm trying to use .htaccess to redirect old urls on my old blog to my new WP blog e.g. need to get http://www.example.com/blog/_archives/2005/10/13/1907475.html to redirect to http://www.example.com/2005/10/13/
Can someone tell me what is wrong with my .htacesss file please.
thanks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# redirect /blog urls to / urls
RewriteCond %{REQUEST_URI} ^/blog [NC]
RewriteRule ^blog/_archives/200([0-9])/([0-9]+)/([0-9]+)/.*.html$ /200$1/$2/$3/ [R=301,QSA,L]
# redirect feed to feedburner
RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC]
RewriteRule ^feed/?.* http://feeds.feedburner.com/Connected-InternetNewsAndDiscussion [L,R=302]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
SRC: Redirecting WordPress Feeds to Feedburner
RewriteRule ^blog/_archives/200([0-9])/([0-9]+)/([0-9]+)/.*.html$ /200$1/$2/$3/ [R=301,QSA,L]
Might want to add a leading / in front of "blog". Like so:
RewriteRule ^/blog/_archives/200([0-9])/([0-9]+)/([0-9]+)/.*.html$ /200$1/$2/$3/ [R=301,QSA,L]
WPChina
Member
Posted 5 years ago #
Yikes, I'm still having problems.
I just changed a blog over to wordpress. The old RSS feed was found at http://www.domain.com/news.rss and I want to change it to the wordpress feed at http://www.domain.com/feed/
I tried doing this, but it did not work:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^feed$ news.rss [L]
</IfModule>
Any ideas what I'm doing wrong?
Tks!
The [L] means that no more rules will be processed if that one matches. So it matches
RewriteRule . /index.php [L]
and stops. Also note that WordPress may overwrite your rules.
Put:
RewriteEngine On
RewriteRule ^feed$ /news.rss
at the start of your htaccess file, before #BEGIN WordPress.
I'm not quite sure if the rule is what you want. If you want to change requests for news.rss to point at the WordPress feed, it's the wrong way round. Change it to:
RewriteRule ^news.rss$ /feed/
WPChina
Member
Posted 5 years ago #
thanks jrawle! I had this answered here:
http://wordpress.org/support/topic/106507
Because this thread was already resolved when I posted my support question, I figured it might be best to start a thread to ensure someone could assist. Many thanks!