lunac Posted March 16, 2007 Share Posted March 16, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/43027-internal-friendly-links-ala-wordpress/ Share on other sites More sharing options...
Daniel0 Posted March 16, 2007 Share Posted March 16, 2007 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']. Quote Link to comment https://forums.phpfreaks.com/topic/43027-internal-friendly-links-ala-wordpress/#findComment-208981 Share on other sites More sharing options...
lunac Posted March 16, 2007 Author Share Posted March 16, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/43027-internal-friendly-links-ala-wordpress/#findComment-209155 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.