I am running PHP on the shared Apache web server. I'm able to edit the .htaccess file.

I am attempting to simulate personal files file structure that's not really there. For instance, I'd like for that URL: www.Stackoverflow.com/jimwiggly to really display www.StackOverflow.com/index.php?name=jimwiggly I acquired midway there by editing my .htaccess file according to the instructions within this publish: http://stackoverflow.com/questions/1987743/php-serve-pages-without-php-files-in-file-structure:

RewriteEngine on
RewriteRule ^jimwiggly$ index.php?name=jimwiggly

This works nicely insofar because the URL bar still shows www.Stackoverflow.com/jimwiggly and also the correct page loads, however, all my relative links remain unchanged. I possibly could go in and place <?php echo $_GET['name'];?> before each link, however it appears like there can be an easy method than that. Furthermore, I suspect my whole approach may be off, must i go relating to this in a different way?

I believe the easiest method to do that would be to adopt the MVC style url manipulation using the URI and never the params.

Inside your htaccess use like:

<IfModule mod_rewrite.c>
    RewriteEngine On
    #Rewrite the URI if there is no file or folder
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

Then inside your PHP Script you need to create a small class to see the URI and split it into segments for example

class URI
   var $uri;
   var $segments = array();

   function __construct()
      $this->uri = $_SERVER['REQUEST_URI'];
      $this->segments = explode('/',$this->uri);

   function getSegment($id,$default = false)
      $id = (int)($id - 1); //if you type 1 then it needs to be 0 as arrays are zerobased
      return isset($this->segments[$id]) ? $this->segments[$id] : $default;

Use like


$Uri = new URI();

echo $Uri->getSegment(1); //Would return 'posts'
echo $Uri->getSegment(2); //Would return '22';
echo $Uri->getSegment(3); //Would return 'robert-pitt-shows-mvc-style-uri-access'
echo $Uri->getSegment(4); //Would return a boolean of false
echo $Uri->getSegment(5,'fallback if not set'); //Would return 'fallback if not set'

Now in MVC There usually like http://site.com/controller/method/param however in a non MVC Style application that you can do http://site.com/action/sub-action/param

Hope this can help you proceed with the application.

To be able to accomplish easier, with more finesse, you could utilize a framework. A framework will help you to use URL routing (you might get it done by hand).

Browse the following SO questions/solutions for many assistance with PHP frameworks.