nirenjan Posted October 3, 2005 Posted October 3, 2005 Hi, I've just moved to TCH from another host and have installed WordPress. I want to permanently redirect requests to /Blog/feed.asp to http://www.nirenjan.com/feed/, while all other files/folders under /Blog/ are to be redirected to the root folder (http://www.nirenjan.com/). Also the request matching needs to be case insensitive. How do I set up this rule in either CPanel or .htaccess? I tried with CPanel to redirect both /blog/ and /Blog/ to the main page, but it's accepting only one and if I try to enter the other, it's giving me a 404 error. Quote
stevevan Posted October 3, 2005 Posted October 3, 2005 While I haven't done this, I'm sure someone will be along with an answer shortly. (I'm curious too! This looks like something I'll file away in my "To Remember" folder!) Quote
TweezerMan Posted October 4, 2005 Posted October 4, 2005 I'd probably use mod_rewrite to do what you're asking. Add the following to the .htaccess file in your /public_html directory: >RewriteEngine on RewriteBase / RewriteRule ^Blog/feed\.asp$ /feed/ [NC,R=301,L] RewriteRule ^Blog/(.*)$ /$1 [NC,R=301,L] The 'NC' indicates a 'no-case' (case-insensitive) comparison, the 'R=301' indicates a permanent redirect, and the 'L' indicates 'last rule' (stop processing mod_rewrite rules if this rule is matched). Hope this helps... Quote
nirenjan Posted October 4, 2005 Author Posted October 4, 2005 Cool, David. I just put in those rules, and Many thanks! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.