I'm running PHP on a shared Apache web server. I can edit the .htaccess file.
I'm trying to simulate a file file structure that is not actually there. For example, I would like for the URL: www.Stackoverflow.com/jimwiggly
to actually display www.StackOverflow.com/index.php?name=jimwiggly
I got halfway there by editing my .htaccess file as per the instructions in this post: 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 as the URL bar still displays www.Stackoverflow.com/jimwiggly
and the correct page loads, however, all of my relative links remain unchanged. I could go back in and insert <?php echo $_GET['name'];?>
before each link, but it seems like there might be a better way than that. Additionally, I suspect my whole approach might be off, should I be going about this differently?