Jump to content

Recommended Posts

Hi All,

 

I'm trying to make my code more "multiple" server friendly , because I'm finding I have to hack at it anytime I use it for a new client and whatever server configuration they have. SOOO... I want to be able to create links on the fly. I would have some config some where that would state whether to use conventional links or friendly links. If I'm using friendly links, I want to pass this off to be figured out within the php rather than in the .htaccess file. Basically, I want to do what WordPress has done so well.

 

Does anyone know how they did this, or has any tutorials about going about this?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/43027-internal-friendly-links-ala-wordpress/
Share on other sites

You could use mod_rewrite or let PHP do the job. To let PHP do it, see this: http://www.phpfreaks.com/tutorials/149/0.php - if you wish to get rid of the index.php part in the URL, then you'd have to place something like

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

in a .htaccess file and then generate it from $_GET['url'] instead of $_SERVER['PATH_INFO'].

yeah -- I think that's what I'm looking for

 

But I should have mentioned that not everything happens on the index page. For example:

/home/ and /about_us/  are both currently at index.php?page=home & index.php?page=about_us

 

However,

/classes/ and /schedule/ are located on their own pages /classmanager/index.php & /classmanager/schedule.php

 

Is this going to make a difference?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.