Announcement

Collapse
No announcement yet.

www permanent redirect on DNP Hosting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • www permanent redirect on DNP Hosting

    Given that search engines prefer unique content, I'm wondering how DNP will allow me to get a base domain to redirect permanently to the www subdomain.

    Currently, the site is available from both
    Code:
    http://example.com
    and
    Code:
    http://www.example.com
    . I'd like to redirect permanently from the former to the latter - but DNP appears unable (or unwilling!) to let me enter www as a sub-domain that can then be forwarded to.

    Having read that DNP appears to be the inflexible cousin of Plesk when it comes to subdomains, am I stuck with the duplicated sites - or will Webhosting UK be able to fix this for me if I ask them nicely?

    Thanks for any and all help!

  • #2
    The ISAPI_Rewrite 3.0 installed on DotnetPanel Servers , ISAPI_Rewrite help you to redirect the example.com to www .example.com by adding simple rule in .htacces file under your WWWROOT folder.


    Redirecting non-www version to www

    RewriteEngine on

    RewriteCond %{HTTPS} (on)?
    RewriteCond %{HTTP:Host} ^(?!www\.)(.+)$ [NC]
    RewriteCond %{REQUEST_URI} (.+)
    RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
    Please go head and add above rule in .htacces file. It's no need to enter www as a sub-domain.

    Comment


    • #3
      That's great - thanks a ton. I'd read elsewhere that .htaccess files were apache only, very happy to find out otherwise!

      Much appreciated.

      Comment

      Working...
      X