Pretty URLs without mod_rewrite, without .htaccess

后端 未结 8 630
轮回少年
轮回少年 2020-12-03 02:27

Without a possibility to access .htaccess I find myself in a creative impasse. There is no mod_rewriting for me. Nevertheless, I want to be able to do the n

8条回答
  •  无人及你
    2020-12-03 02:50

    A quite simple way is to:

    • declare a 404 ErrorDocument (e.g. PHP) in .htaccess
    • parse the query using $_SERVER and see if it corresponds to any result
    • if so replace the HTTP status 404 with status 200 using header() and include index.php

提交回复
热议问题