Jump to content

URL variable without GET request?


t0mbr0wn

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/192767-url-variable-without-get-request/
Share on other sites

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/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.