cattarantadoughan
cattarantadoughan

Reputation: 509

changing url name and what file it points to in php

I'm new to web development but i know some php basic stuff. Using ftp, i create directories then create simple php scripts there, simple as echoing a string. Which can be accessed like,

www.sampledomain.com/folder1/subfolder2/hello.php

After some time, my friend introduced me to wordpress which is what they described as CMS. I tried to visit her site www.majaflores.com then i click on some stuff there and i noticed the url changed to http://majaflores.com/project/if-i-let-you-in-please-dont-break-anything/

At first, its pretty normal for me because its just a link where there is a folder named "project" and inside it another folder named "if-i-let-you-in-please-dont-break-anything". But when she showed me the ftp folders directory, i didnt see any folder named "project" under main folder of the domain. How did wordpress manage to do this? and how can i implement this manually?

Upvotes: 0

Views: 50

Answers (2)

Itai Bar-Haim
Itai Bar-Haim

Reputation: 1674

Just wanted to say that like most server-side code environments, PHP also let you parse URLs "manually" and decide what to do accordingly, be it return a file or generate some content.

You can find more information about how PHP is parsing URLs in here:

http://php.net/manual/en/function.parse-url.php

and some discussion regarding it in here:

URL handling – PHP vs Apache Rewrite

Upvotes: 1

Harry
Harry

Reputation: 326

This is they way WordPress stores data. U can further see the setting under Permalink.

Under Permalink, u can have options to render ulr as page id, category names and more. You can also use your own format over there.

Just a note, WordPress stored data in database not as a content on FTP directory.

Upvotes: 1

Related Questions