Jump to content


Changing dynamic URLs into Static URLs

  • Please log in to reply
1 reply to this topic

#1 SagaLore

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 05 September 2003 - 03:21 PM

I\'m using a simple CMS that references content with ?id=27. I know that Google will spider some dynamic links but to be on the safe side I want to try and make that static.

I have created an .htaccess file with:

<FilesMatch \"^id$\">
ForceType application/x-httpd-php

And then another file \"id\" with:


$idpath = explode(\"/\",$_SERVER[\'PATH_INFO\']);
$newid = intval($idpath[1]);



What this does it turn:

Two dilemmas:

I don\'t want to have to use an absolute path in the id file because this feature is going to be made available to other users of the CMS I\'m using.

When you use the static path, relative links in the html that is included are broken. This is because they think they are in another subdirectory when in fact it\'s just smoke and mirrors.

So instead of rewriting all my html with absolute paths or doing some other hack, I would like to accomplish this:


That way the relative links work okay. I was looking at Apache core directives and came up with something like:

<Location ~ \"/id*\">
//some type of parsing here

But I\'m rather new to both php and .htaccess so for now this is getting the best of me. I know what I want to do logically but don\'t know what to do syntactically.


#2 catman

  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 07 September 2003 - 12:58 AM

use mod_rewrite
tut @
Are you ready to get Jolted? [br]www.getJolted.com

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users