www.webdeveloper.com
Results 1 to 7 of 7

Thread: Help a new guy out.

  1. #1
    Join Date
    Jun 2012
    Posts
    6

    Help a new guy out.

    Hey,

    I'm kinda new at programming, but over the past few months have managed to understand CSS,HTML fairly well and now I'm getting into PHP. I've found I learn a lot more by creating rather than studying.

    A project I want to attempt this weekend is to make a multi-page small business website using only CSS, HTML, and PHP. I'm going to post any questions as I go onto this thread.

    My first question:

    I know I'll have different files like index.php for home and single.php for interior pages. How do I designate the URL location for these interior pages? In other words, how do I make single.php go to domain.com/about-us. Is there some kind of tag I need to designate to make each page located at a particular URL? What if I wanted to make another single.php template go to domain.com/contact. Could someone help me out here or point me towards a good tutorial?

    For example, I know that I could make an about page <a href="about.php">About Us</a> and link to it that way, but would rather create the more common and seo friendly URLs like <a href="/about-us">About Us</a>. How do I get rid of this "page/file name" attribute and migrate to URLs site-wide?

    Thanks,

    Zach
    Last edited by zsemago; 02-26-2013 at 09:49 AM.

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,123
    One suggestion would be to simply use the directory structure you want. Call every page "index.php" but put them in the correct directory. For example, create a directory called "about-us" and then add an index.php file to that directory which includes the markup for your about us page. Then your navigation will work with domain.com/about-us.
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    Jun 2012
    Posts
    6
    Quote Originally Posted by cbVision View Post
    One suggestion would be to simply use the directory structure you want. Call every page "index.php" but put them in the correct directory. For example, create a directory called "about-us" and then add an index.php file to that directory which includes the markup for your about us page. Then your navigation will work with domain.com/about-us.
    I don't know what you mean by "directory."

    To make an example as simple as possible, I have 3 files to make a site with 2 pages.

    index.php > Home "/"
    about.php > About us "about-us"
    style.css

    ....I upload all 3 of these into my HostGator file manager for that particular domain and I'm done. Could you tell me how to use a directory in the above example?

    Thanks

  4. #4
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,123
    A directory is a folder. Can you create or upload folders (directories)?
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  5. #5
    Join Date
    Jun 2012
    Posts
    6
    Yes I can create a folder for each page with a SEO-friendly URL.

    ...so that is all you do to designate a URL?

  6. #6
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,123
    Yep!
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  7. #7
    Join Date
    Nov 2012
    Posts
    450
    Good network on LinkedIn, I just checked.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles