Jump to content


VlexoFree Notice

Interviews will be open every Friday starting at 12am PDT and lasting for 24 hours.

- - - - -

301 Redirect


  • Please log in to reply
4 replies to this topic

#1 atanas13

atanas13

    Member

  • Members
  • 11 posts

Posted 11 September 2011 - 12:58 PM

Account Plan: Personal 300
cPanel UserName: atanas13
Your Domain or Subdomain: pricebysize.com
Browser: Chrome
System (Mac/PC/Linux): PC
Nature Of Problem: Other
Error you are Getting [If applicable]: Internal Server Error. The problem is most likely due to a misconfiguration in the website's ".htaccess" file or the page you're trying to view has insecure file permissions.
Problem:
I am trying to redirect all non-www requests to the www domain, using the Redirect directive in the .htaccess file:
<VirtualHost *:80>
  ServerName pricebysize.com
  Redirect 301 / http://www.pricebysize.com/
</VirtualHost>
<VirtualHost *:80>
  ServerName www.pricebysize.com
</VirtualHost>

But i get the error mentioned above.

Thanks in advance!

 

Edited by atanas13, 11 September 2011 - 12:58 PM.


Ad Bot


      #2 Eli L

      Eli L

        VlexoFree Owner

      • Owner
      • 6,950 posts
      • LocationWashington, USA

      Posted 11 September 2011 - 10:23 PM

      I think all you need is the line starting with "redirect". Everything else is not needed.

      Posted Image


      Please do not PM me for support (unless its a private matter). Instead, post in the appropriate forum and help will be provided accordingly.
      Helpful links: Terms of Service | Privacy Policy | Wiki - Tutorials & Help | VlexoFree Support |


      #3 atanas13

      atanas13

        Member

      • Members
      • 11 posts

      Posted 12 September 2011 - 01:00 AM

      Thanks for the help! But in your case, it creates a redirect loop. :(

      This webpage has a redirect loop
      The webpage at http://www.pricebysize.com/ has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

      The idea is to use VirtualHost to tell only the non-www domain to redirect, but it doesn't work (I get the error mentioned in my previous post).

      Edited by atanas13, 12 September 2011 - 01:00 AM.


      #4 Sharad D

      Sharad D

        Advanced Member

      • VlexoFree Support
      • 1,349 posts
      • LocationBengaluru, India

      Posted 12 September 2011 - 07:19 AM

      Try
      Options +FollowSymlinks
      RewriteEngine on
      rewritecond %{http_host} ^domain.com [nc]
      rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
      

      http://www.webconfs....t-a-webpage.php

      With great power comes great responsibility

      Please do not PM me for support. Instead, post in the appropriate forum and help will be provided accordingly.
      Helpful links: Terms of Service | Privacy Policy | Wiki - Tutorials & Description | VlexoFree Support


      #5 atanas13

      atanas13

        Member

      • Members
      • 11 posts

      Posted 12 September 2011 - 08:43 AM

      It works. Thanks! :)




      0 user(s) are reading this topic

      0 members, 0 guests, 0 anonymous users