SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to hide the folder name in url path

    Hi

    All

    I have one form when user cliks on the submit button, it will go to another page of my web site

    I want to hide the folder path in the url

    for example www.test.com/forms/read.php


    here i want to show only www.test.com

    please help me out

    Thanks
    MD.Samiuddin

  2. #2
    SitePoint Member
    Join Date
    Dec 2006
    Location
    Huddersfield, UK
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add an index.php flle to the root folder which contains:

    <?php
    include("forms/read.php");
    ?>

    If you want to avoid it loading the /forms/ folder all the time then you need to use htaccess, not PHP. Here is the basics of htaccess:
    http://httpd.apache.org/docs/2.0/mod...ml#rewritecond

    Hope that helps

    Dave
    UK Web Hosting
    from Seiretto - servering websites for over 10 years.

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There must be a rule for how you want to show in the address bar and what to show in the page. Or you just want to show home page whatever it is typed in the address bar? You can achieve this with ModRewrite of Apache. See:
    http://www.sitepoint.com/apache-mod_rewrite-examples/
    http://www.sitepoint.com/guide-url-rewriting/
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  4. #4
    SitePoint Zealot Sogo7's Avatar
    Join Date
    May 2011
    Posts
    129
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Have a Google around for 'url prettification'

    There are plenty of demos complete with scripts like this one
    http://www.9lessons.info/2009/11/pre...cess-file.html

  5. #5
    SitePoint Member
    Join Date
    Apr 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    easy ****.

    <?php
    switch(key($_GET)) {
    default:
    include('read.php');
    break;
    }
    ?>


Bookmarks

Posting Permissions

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