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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .htaccess question

    I have (or rather had) a site where someone would enter www.mysite.com/something. The 'something' did not exist, but using .htaccess I sent it to a page called www.mysite/com/lookup.html where a bit of javascript would parse that piece off the URL and use it as data. I looked 'something' up in a database using php, and if it found it, I sent it to a page that would display some stuff from the database.
    I say 'had' instead of 'have', because the site is now on a different (though still apache) host, and the .htaccess is working differently. Now when I look at the URL in lookup.html, instead of finding the original www.mysite.com/something, I am finding www.mysite.com/lookup.html. Any idea what I could have done wrong? On the old site, I had coded the .htaccess from scratch. On the new site, the host had generated a bunch of additional lines. I can attach the old and new version if that will help at all.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by Bruce.Burnell View Post
    I can attach the old and new version if that will help at all.
    Yes please do.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Aug 2006
    Posts
    64
    Thanks
    0
    Thanked 1 Time in 1 Post
    you may not have done anything wrong. The htaccess file functionality/defaults can be controlled by what is in the apache conf file so your apache servers very likely are configured differently:

    so to redirect any specific file this should work but only if you have the authority as granted in apache conf file to do it.


    Code:
    Redirect permanent /something.htm http://www.mydomain.com/anydirectory/anyfilename.htm
    easiest if you give the actually file names and locations and then I can be certain of getting it right.

  • #4
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The thing is, it does redirect. My problem is getting to the value of the original URL.

  • #5
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply. The problem turned out to be...programmer headspace. In the environment that worked, I had coded the error 404 page as a file path off of the document home. In the one that wasn't working, I had enteted it as a URL. As soon as I changed it to a file path, it worked as I wanted it to.


  •  

    Posting Permissions

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