I want to create a Q&A site like Yahoo Chiebukuro.

Asked 2 years ago, Updated 2 years ago, 391 views

For Q&A sites like Yahoo Chiebukuro, I think each question has a unique URL. Would it be possible to receive it from the database and display it and give it a unique URL at the same time?
If possible, please let me know how to do it roughly.

php database

2022-09-30 21:49

1 Answers

Rather than giving a URL,

When accessed by a virtual URL, use the values contained in the URL to retrieve and display information from DB
The idea is thatThis feature is called URL rewrite for the web server.

http://example.com/hoge1/hoge2

when accessed in the . http://example.com/index.php?id=hoge1&name=hoge2
Rewrite and process internally (how to rewrite depends on your settings).

Usually, you need to write down the settings in detail, but
( .htaccess for Apache, nginx.conf for Nginx, web.config for IIS)
Major PHP frameworks, including Ravel and CakePHP, include
It has routing features that make it easy.


2022-09-30 21:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.