Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: "Christoph M. Becker" Newsgroups: comp.lang.php Subject: Re: change page url according to id Date: Thu, 23 Jul 2015 01:12:26 +0200 Organization: solani.org Lines: 21 Message-ID: References: <0bc4ef40-a643-427a-8971-0d5d9ed574d5@googlegroups.com> <6rurx.288487$Pb6.182445@fx04.iad> <1473148.XobnLxc11U@PointedEars.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1437606740 30253 eJwFwQERADEIAzBL8INC5fwN6l/Ckjxw3AokIpXSDoQiLHy+PRWWFUuKau6/tO47k3TrG/MAGawRAg== (22 Jul 2015 23:12:20 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Wed, 22 Jul 2015 23:12:20 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 X-User-ID: eJwFwYEBACAEBMCVQj7Gofz+I3TnBsE9G47tdK5Qi25UPATf4JbYivZUjtoxYgZFYWfy+Qcg4RGn In-Reply-To: Cancel-Lock: sha1:giXX029X4GyVKZWtm2S5vwWeJI0= X-NNTP-Posting-Host: eJwFwYEBwCAIA7CXhrSsnCMo/59gQg+L/hEMcDin3W8RUKRdiuZdO1UD1LfGlmwWSsqzjf0AFnoQ1Q== Xref: csiph.com comp.lang.php:15608 apoorv.kanungo@gmail.com wrote: > Guys I am sorry if I did not put my question correctly I know we can > do that with htaccess but I have to manually enter redirect code in > the htaccess. > > I want it to be dynamic so that if user enter title of the page > contact us the url in the browser will be example.com/contact us. > > kind of like wordpress where it does not have multiple pages but one > default template and url and title of all the pages are different. > > can we do that with $_SERVER['REQUEST_URI'] I suggest you have a look at the CGI variable `PATH_INFO`, which is supposed to be available in PHP via `$_SERVER['PATH_INFO']`. -- Christoph M. Becker