How to redirect www.mydomain.net to www.mydomain.net/blog

I am using "Ionics Isapi Rewrite Filter"

I have a website with an empty root www.mydomain.net and I want when someone uses that url redirect to my blog www.mydomain.net/blog, how is this possible?

0


a source to share


3 answers


You don't need to overwrite REDIRECT.

You can do this with a default document (like index.html) in docroot with Meta Refresh tag.

The content of index.html could be like this:



<META HTTP-EQUIV=Refresh CONTENT="0; URL=blog">

      

Now, if you really want REWRITE, this is different.

+3


a source


I'm going to assume that since you are using the Isapi Rewrite filter you are using in IIS (this answer works for other servers, but my instructions are specifically for IIS). You do n't really want to use meta-refresh , and for SEO purposes, you want to use a permanent (301) redirect.

In IIS, you do this:



  • Create blank page index.html
  • Right click on this page in IIS and open Properties dialog
  • On the File tab select URL Redirect
  • Change the "Forward to" value to http://www.mydomain.net/blog
  • Select the "Permanent redirect for this resource" checkbox.
+1


a source


Here's a solution for ISAPI_Rewrite 3 Lite (which is free):

RewriteBase /
RewriteCond %{HTTP_HOST ^www\.mydomain\.net$ [NC]
RewriteRule ^$ /blog [NC,R=301,L]

      

0


a source







All Articles