johnmccc Posted February 17, 2010 Share Posted February 17, 2010 Hi, I want to change the url with PHP, if this is possible (Let's suppose we don't have to watch if we are in a folder or not) For example my current url is: http://www.domain.com/php And I want to change it with PHP into: http://www.domain.com/php/ On a very simple way the PHP would look like this (but oufcourse it will not work): $_SERVER = $_SERVER + "/"; Quote Link to comment Share on other sites More sharing options...
thunder708 Posted February 17, 2010 Share Posted February 17, 2010 $_SERVER['SERVER_NAME'] = $_SERVER['SERVER_NAME']."/"; Try that my two previous attempts didnt work, if you saw it. it should but you could just have it as: $server = $_SERVER['SERVER_NAME']."/"; just to save typing time Quote Link to comment Share on other sites More sharing options...
johnmccc Posted February 17, 2010 Author Share Posted February 17, 2010 try $_SERVER = $_SERVER."/" I was just giving an example of how it should look like, but the syntax will be definitely wrong Quote Link to comment Share on other sites More sharing options...
thunder708 Posted February 17, 2010 Share Posted February 17, 2010 just look at my last post ive edited it and tested it out on my own website and it works and btw either way that i have suggested works Quote Link to comment 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.