Monday, April 2, 2018

How to configure a site so that I can have a url without directory the way Wordpress did?

Leave a Comment

Say I made a website with Wordpress, and created a few pages say www.foo.com/bar1 and www.foo.com/bar2. I have no idea where they stored this, since there is no /bar1 and /bar2 directory. Unlike when I created a site from scratch and added new directories like /public_html/bar1.

So how do I configure it like this without Wordpress?

3 Answers

Answers 1

It depends on the technology\framework you're using. Google 'Routing'.

Example for Asp.Net: https://msdn.microsoft.com/en-us/library/cc668201.aspx

Answers 2

Maybe you can use a framework like ZK framework to create a div content and refresh it according to the request. This way, you may not have to update any url in your application. You just refresh an inner div by dynamicaly including a new view.

Maybe this would help:

https://www.zkoss.org/wiki/ZK_Component_Reference/Essential_Components/Include

Answers 3

When you create a page using WordPress, your all page will have a dynamic content with same layout from page.php file which is a mandatory file of a theme and served according to the routes. You will not see the page.php in URL or page. WordPress saves your page title in database and servers it accordingly (check the permalink section of WordPress).

When you create a custom site from scratch you can do the same by creating a file and re-use it according to the routes. You don't need directory for that.

Note: File extensions like .php .html are removed using .htaccess file.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment