Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how to redirect htaccess code?

    HI Everybody,

    My php pages are strored in www.something.com/httpdocs/vasu folder.
    so that we should be enter web home page like this, http://www.somthing.com/vasu but idont want to enter fullpath of webfolder www.something.com/httpdocs/vasu just simply enter like this: http://www.somthing.com.

    i have written like this:

    ReWritten EngineOn
    ReWriteCond %{QUERY_STRING} ^(vasu)
    RewriteRule ^\vasu$ http://something.com

    what is wrong in my code?

  • #2
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for asking this question vasu.

    I am also trying to do the same thing for two of my domains and need the solution desperately.

    May be some genius will help us.

  • #3
    New Coder
    Join Date
    Jul 2011
    Posts
    67
    Thanks
    0
    Thanked 13 Times in 13 Posts
    Quote Originally Posted by samra1982 View Post
    Thanks for asking this question vasu.

    I am also trying to do the same thing for two of my domains and need the solution desperately.

    May be some genius will help us.
    Coincidence much? Anyway, it sounds like ideally what you are attempting wouldn't be done with mod_rewrite, by the sounds of it, your DocumentRoot directive for apache needs changing.

  • #4
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    2
    Thanks
    0
    Thanked 1 Time in 1 Post
    rewritecond %{http_host} ^site.com [nc]
    rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc]

    This is how you redirect a site. Hope this helps

  • Users who have thanked justjojostudios for this post:

    samra1982 (08-29-2011)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •