t0mbr0wn Posted February 21, 2010 Share Posted February 21, 2010 Hi there, I'm creating and coding a news / article based website. I want the url of the articles to be in the following format --> http://www.mydomain.com/category/articleTitle or http://www.mydomain.com/category/subCategory/articleTitle e.g. http://www.mydomain.com/interviews/an-interview-with-john-smith I'm guessing i would have to grab the url, remove the root domain, and put the rest into a variable to be processes in a query sent to my database to grab the corrisponding article. The thing is, i don't know how to go about even starting to write this code, or even whether that is the right way. Any help would be great! Thanks, Tom Quote Link to comment https://forums.phpfreaks.com/topic/192767-url-variable-without-get-request/ Share on other sites More sharing options...
ohdang888 Posted February 21, 2010 Share Posted February 21, 2010 Nope. This requires a mod-rewrite on your server .htaccess file. They're not too complicated, check out these tutorials: Open your .htaccess file (google it if you don't know about it), and check out these tutorials: http://roshanbh.com.np/2008/03/url-rewriting-examples-htaccess.html http://www.easymodrewrite.com/ Quote Link to comment https://forums.phpfreaks.com/topic/192767-url-variable-without-get-request/#findComment-1015454 Share on other sites More sharing options...
cags Posted February 21, 2010 Share Posted February 21, 2010 It doesn't require mod_rewrite, the OP could do it the way they described. Granted mod_rewrite is the far more sensible approach. Quote Link to comment https://forums.phpfreaks.com/topic/192767-url-variable-without-get-request/#findComment-1015594 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.