htaccess needed - my hosting cant solve it

Discussion in 'Programming' started by gclass, Aug 19, 2009.

  1. #1
    Hi

    I have a tube site which installed in subfolder like:

    www.mysite.com/video/

    I want to have a redirection (which is safe for SEO) of non-www and www to this path including the rest of the url which containing the video file name etc.

    the rules I have now are:
    
    RewriteCond %{HTTP_HOST} ^mysite.com
    RewriteRule (.*) http://www.mysite.com/video/$1 [R=301,L]
    
    RewriteCond %{HTTP_REFERER} !^http://www.mysite.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^http://mysite.com/ [NC]
    RewriteRule ^$ http://www.mysite.com/video$1 [R,L]
    Code (markup):
    all working well , BUT when you try to access :

    mysite.com/SOMETHING it redirect to http://www.mysite.comSOMETHING/
    it drops the /video/ for some reason...

    any help?
     
    gclass, Aug 19, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteRule ^$ http://www.mysite.com/video$1 [R,L]

    Aren't you missing a slash there?

    RewriteRule ^$ http://www.mysite.com/video/$1 [R,L]
     
    premiumscripts, Aug 19, 2009 IP
  3. gclass

    gclass Active Member

    Messages:
    337
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Hi premium,
    still the same with and without the slash..
     
    gclass, Aug 19, 2009 IP
  4. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #4
    premiumscripts, Aug 19, 2009 IP
  5. gclass

    gclass Active Member

    Messages:
    337
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #5
    gclass, Aug 19, 2009 IP
  6. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well, you probably have some other rewrite rules then. Check your htaccess again and also ask your host your virtualhost directives in httpd.conf to see if you are doing any rewrites there.
     
    premiumscripts, Aug 19, 2009 IP
  7. Webray

    Webray Active Member

    Messages:
    469
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #7
    Never mind. I see somebody has already given that answer.
     
    Webray, Aug 19, 2009 IP