Mod_rewrite flat links

后端 未结 2 356
忘了有多久
忘了有多久 2021-01-27 05:36

I\'m trying to display my get variables as flat links. Want to change from this:

http://mydomain.com/index.php?page=shop&var1=hat&var2=10
2条回答
  •  心在旅途
    2021-01-27 06:15

    You could just direct all request directly to index.php (called bootstrapping), and let the script parse out the variables.

    This is how it's done with Zend Framework, you should take a look at it. ZF also has loads of other goodies you could utilize.

    This is my rewrite block from one of my vhosts with a ZF powered website.

        RewriteCond %{REQUEST_FILENAME} !-l
        RewriteCond %{REQUEST_FILENAME} !-s
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI}      !^/favicon.ico
        RewriteRule ^.*$ index.php [NC,L]
    

提交回复
热议问题