+ Reply to Thread
Results 1 to 4 of 4

Thread: URL Friendly Dynamic Pages

  1. #1
    aking47 is offline x10Hosting Member aking47 is an unknown quantity at this point
    Join Date
    Oct 2006
    Posts
    13

    URL Friendly Dynamic Pages

    Got dynamic content on your website, but the search engines won't crawl it? Don't like the look of the ?page=home ?

    OR

    Ever changed the template of your site? Is your site set up so that if you want to change anything, you have to edit every individual page?
    PHP Code:
    <html>
    <!-- Put the top of your template here -->
    <?php
      $url 
    $_SERVER['REQUEST_URI'];
      
    $url explode("/",$url);
      
    $page $url[count($url)-1];
      if (
    $page != "index.php") { // You may want to change index.php to the page you're actually using
        
    include($page); // You can include files from another directory with include("directory/".$page);
      
    }
      else {
        include(
    "home.php"); // Change home.php to your default page
      
    }
    ?>
    <!-- Put the bottom of your template here -->
    </html>
    Put your own content in the same folder as your index.php and reference it like this:
    http://www.mydomain.com/index.php/games.php or
    http://www.mydomain.com/index.php/my_site.php

  2. #2
    HyDr@ is offline x10 Sophmore HyDr@ is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    UK - Kent
    Posts
    134

    Re: URL Friendly Dynamic Pages

    Thanks for it, I find it useful.

    - Portfolio of High quality Anime and Gaming Wallpapers/Website Creation/Anime Scans/Photoshop Tutorials
    - Devright.org ~ The right way to develop

  3. #3
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: URL Friendly Dynamic Pages

    Thanks for this information, but im going to stick with Mod-Rewrite.
    Thanks,
    Brandon Long

  4. #4
    Pingy's Avatar
    Pingy is offline x10Hosting Member Pingy is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    46

    Re: URL Friendly Dynamic Pages

    I'm really glad you mentioned ModRewrite, Brandon; I've been doing a lot of research on it, but every site that mentioned it tended to use examples that, to me at least, made it seem a lot more difficult than it should be. On my site, I'd like a user's avatar to be posted on their profile; the image is going to be generated dynamically via PHP, with a URL similar to /images/avatar.php?user=#SOME_USER#. I was hoping you might provide some insight regarding which directives I should include in my .htaccess file to get this functionality. Any assistance you provide is, of course, greatly appreciated.
    Last edited by Pingy; 09-16-2007 at 03:24 AM.

+ Reply to Thread

Similar Threads

  1. how can i convert Php pages and code into asp pages and code
    By n4tec in forum Scripts & 3rd Party Apps
    Replies: 11
    Last Post: 01-10-2009, 09:40 PM
  2. dynamic pages
    By thecarver in forum Free Hosting
    Replies: 3
    Last Post: 09-29-2006, 09:27 AM
  3. Ads on my pages
    By cokacola650 in forum Free Hosting
    Replies: 2
    Last Post: 02-16-2006, 10:38 AM
  4. Replies: 7
    Last Post: 09-16-2005, 10:27 AM
  5. Dynamic Error Pages
    By o0slowpaul0o in forum Tutorials
    Replies: 12
    Last Post: 07-03-2005, 03:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers