diasdaman Posted October 20, 2008 Share Posted October 20, 2008 How do you access a page's URL in PHP after it has been re-written to be SEF? Like, instead of http://www.example.com/index.php?page=news I want a php variable that will return what the world sees (since I'm SEF'ing), which is http://www.example.com/news. $_SERVER['REQUEST_URI'] does not work. It returns the "true" url (http://www.example.com/index.php?page=news). Thanks!!! Quote Link to comment https://forums.phpfreaks.com/topic/129284-php-sef-url/ Share on other sites More sharing options...
felipeebs Posted October 20, 2008 Share Posted October 20, 2008 mod_rewrite in a .htaccess file may do it Quote Link to comment https://forums.phpfreaks.com/topic/129284-php-sef-url/#findComment-670271 Share on other sites More sharing options...
diasdaman Posted October 20, 2008 Author Share Posted October 20, 2008 mod_rewrite in a .htaccess file may do it I'm confused. mod_rewrite in a .htaccess file is how I'm changing the URL already. But my question is how do I "call" the new url within PHP, much in the way you'd use $_SERVER['REQUEST_URI']. Quote Link to comment https://forums.phpfreaks.com/topic/129284-php-sef-url/#findComment-670276 Share on other sites More sharing options...
felipeebs Posted October 20, 2008 Share Posted October 20, 2008 mod_rewrite is a apache server built in it catches the requested url and, with some regex, change it the user will still see http://www.example.com/news but php will be requested for http://www.example.com/index.php?page=news Quote Link to comment https://forums.phpfreaks.com/topic/129284-php-sef-url/#findComment-670278 Share on other sites More sharing options...
rhodesa Posted October 20, 2008 Share Posted October 20, 2008 he IS using mod_rewrite.... diasdaman...that is very odd, as $_SERVER['REQUEST_URI'] should return the rewritten URL Quote Link to comment https://forums.phpfreaks.com/topic/129284-php-sef-url/#findComment-670283 Share on other sites More sharing options...
diasdaman Posted October 20, 2008 Author Share Posted October 20, 2008 he IS using mod_rewrite.... diasdaman...that is very odd, as $_SERVER['REQUEST_URI'] should return the rewritten URL hmm. Would it help to mention that I'm using Joomla and an SEF extension? Quote Link to comment https://forums.phpfreaks.com/topic/129284-php-sef-url/#findComment-670294 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.