1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HTACCESS Problem. Please Help

Discussion in 'White Hat SEO' started by seoconsultant2005, Feb 9, 2009.

  1. seoconsultant2005

    seoconsultant2005 Junior Member

    Joined:
    Dec 9, 2008
    Messages:
    129
    Likes Received:
    654
    Hi,

    I recently upload a newly made website and now I am facing many problems.

    First thing is my website address is

    www.seosem-india.com

    I want htaccess code to redirect all request to non-www domain. http://seosem-india.com

    second thing is, I have wordpress installed in sub directory.

    http://seosem-india.com/SEO-Blog/

    I tried some htaccess code but everytime I face some problem.

    Can someone please post here the code for htaccess for

    non-www redirect code
    wordpress htaccess code to get search enigine friendly URL.

    Also, please post which code in which htaccess file I need to upload on root or sub-domain.


    Thanks
    Pearl
     
  2. marcuskona

    marcuskona Junior Member

    Joined:
    Sep 27, 2008
    Messages:
    168
    Likes Received:
    654
    Occupation:
    IT
    Location:
    127.0.0.1
    Home Page:
    edit root httaccess add this

    #RewriteCond %{HTTP_HOST} ^(.+).seosem-india.com [NC]
    #RewriteRule ^(.*)$ http://seosem-india.com/$1 [R=301,NC,L]


    not sure if this will work but worth a shot.

    good luck.
     
  3. seoconsultant2005

    seoconsultant2005 Junior Member

    Joined:
    Dec 9, 2008
    Messages:
    129
    Likes Received:
    654
    Thanks... I am gonaa try this.
     
  4. seoconsultant2005

    seoconsultant2005 Junior Member

    Joined:
    Dec 9, 2008
    Messages:
    129
    Likes Received:
    654
    this code is not working :(
     
  5. seoconsultant2005

    seoconsultant2005 Junior Member

    Joined:
    Dec 9, 2008
    Messages:
    129
    Likes Received:
    654
    Can somebody please help... my website is only opening without www if I enter www it shows page not found
     
  6. xhpdx

    xhpdx Regular Member

    Joined:
    Sep 21, 2008
    Messages:
    331
    Likes Received:
    2,160
    Occupation:
    Coder
    Location:
    EU
    wordpress automatically changes the .htaccess from settings->permalinks

    as for www to non-www this code should do the trick:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.seosem-india\.com$ [NC]
    RewriteRule ^(.*)$ http://seosem-india.com/$1 [R=301,L]
     
  7. xhpdx

    xhpdx Regular Member

    Joined:
    Sep 21, 2008
    Messages:
    331
    Likes Received:
    2,160
    Occupation:
    Coder
    Location:
    EU
    that will never work because of the # which means the line is comment
     
  8. stinky_boy

    stinky_boy Junior Member

    Joined:
    Nov 21, 2008
    Messages:
    128
    Likes Received:
    35
    Occupation:
    head games
    Location:
    money street
    hxpdx's code should do the trick. Just add it above any code that came with your site.
     
  9. seoconsultant2005

    seoconsultant2005 Junior Member

    Joined:
    Dec 9, 2008
    Messages:
    129
    Likes Received:
    654
    Thanks I am gona try this... meanwhile can you please check if my website is opening with www and with non-www as well. Becuase its not opening for me when i type www :(
     
  10. goldstrike4u

    goldstrike4u Junior Member

    Joined:
    Dec 22, 2007
    Messages:
    189
    Likes Received:
    124
    Your website opens fine both ways.
     
  11. seoconsultant2005

    seoconsultant2005 Junior Member

    Joined:
    Dec 9, 2008
    Messages:
    129
    Likes Received:
    654
    I really failed to understand everybody says this, site is opening in both ways. But trust me I tried my website on 6 computers never open with www
     
  12. oldenstylehats

    oldenstylehats Elite Member Premium Member

    Joined:
    Apr 10, 2008
    Messages:
    1,893
    Likes Received:
    1,196
    What browsers are you using? I just tried and that RewriteRule appears to be in place. Did you change your host or nameserver recently.
     
  13. seoconsultant2005

    seoconsultant2005 Junior Member

    Joined:
    Dec 9, 2008
    Messages:
    129
    Likes Received:
    654
    I bought a new domain and hosting on 31st of Jan and from last 9 days I am trying to solve this issue.

    I have firefox 3.0.6 & IE 7

    working without typing www but if i type www it just show me page not found
     
  14. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,884
    Likes Received:
    1,932
    You may need to flush DNS as it sounds like your PC is relating to the old IP that the domain was hosted on.
     
  15. confined

    confined Regular Member

    Joined:
    Jan 4, 2009
    Messages:
    216
    Likes Received:
    91
    open up start menu click run, type cmd
    then type

    ipconfig /flushdns

    and then close all browser windows. wait 5 minutes.

    In vista just type ipconfig /flushdns into that dumb ass fucking search box in the start menu that always gets in the way for me.
     
  16. BlackMelvyn

    BlackMelvyn Regular Member

    Joined:
    Jul 8, 2008
    Messages:
    202
    Likes Received:
    272
    Home Page:
    Works both ways for me too...
    Empty cache and cookies as you must have used a 301 redirection with the wrong Apache mode rewrite syntax.
    That should be OK then ;)
     
  17. seoconsultant2005

    seoconsultant2005 Junior Member

    Joined:
    Dec 9, 2008
    Messages:
    129
    Likes Received:
    654
    Sad :( after doing this its still shows me "Address not found" but at the same time if I type "seosem-india.com" it works fine but not with www.seosem-india.com.

    That is becoming a problem for me it does work for you but not for me and not even on my friends computer.

    Well I am from India - New delhi. It seems that no one able to access website with www in India.
     
  18. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,884
    Likes Received:
    1,932
    open up start menu click run, type cmd
    then type

    ipconfig /flushdns

    Then RESTART.

    And try again, it sometimes takes a couple days to clear up, try clearing cookies, temp data, content cache, restarting and try again.
     
  19. oldenstylehats

    oldenstylehats Elite Member Premium Member

    Joined:
    Apr 10, 2008
    Messages:
    1,893
    Likes Received:
    1,196
    Yeah, it very well could be on your ISP's end. Do you and all of your friends all get your internet access from the same company? Sometimes to cut down on load and bandwidth, ISP's won't update their DNS entries for a few days at a time.
     
  20. seoconsultant2005

    seoconsultant2005 Junior Member

    Joined:
    Dec 9, 2008
    Messages:
    129
    Likes Received:
    654
    I tell you something ... the best part is I myself has 3 type of connections (ISP) doesnt work on any1 not on other ISP's as well.