Question

How to enable clean url on Debian 9?

Posted February 14, 2019 580 views
Apache PHP Debian

Hello,

I have a website and for example I have url like this “example.com/games” and it should show the page with games but it shows error:

Not Found

The requested URL /games was not found on this server.

What I have to do to show a page instead of an error?

Thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

2 answers

Hey friend!

Good question. There are different ways to handle this. The easiest example would be to create a folder named “games” in the website’s document root, and then add an index file which contains your content.

A more common example these days is to use your web server’s rewrite functionality to funnel all URLs into index.php which translates the URL into the right content request, returning the desired content based on the URL given. Wordpress does this on Apache by writing rewrite rules to a .htaccess file in the website’s document root, for example.

Jarland

Thank You Jarland,

the first way looks interesting.

Submit an Answer