Pretty URLs without mod_rewrite, without .htaccess

后端 未结 8 646
轮回少年
轮回少年 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:35

    I know this question is very old but I didn't see anyone else suggest this possible solution...

    You can get very close to what you want just by adding a question mark after the domain part of the URL, ie;

    http://www.example.com/?Blog/2009/12/10/
    http://www.example.com/?Title_Of_This_Page
    

    Both of the above HTTP requests will now be handled by the same PHP script;

    www.example.com/index.php
    

    and in the index.php script, $_SERVER['REQUEST_URI'] for the two pages above will be respectively;

    Blog/2009/12/10/

    Title_Of_This_Page

    so you can handle them however you want.

提交回复
热议问题