.htaccess mod_rewrite subdirectory to URL parameter

后端 未结 3 669
日久生厌
日久生厌 2021-01-07 03:22

I hope this was not asked over and over again before, but I didn\'t get further to an answer using google, w3schools and so on. So here is my question: I\'m writing a script

3条回答
  •  囚心锁ツ
    2021-01-07 03:47

    Thanks for all the help so far! You guys are just awesome!

    I figured out that a symbiosis of both of your solutions works well for me:

    RewriteEngine on
    RewriteBase /projects
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} -d
    RewriteRule ^([^/]+)/?$ index.php?dir=$1 [QSA,L]
    

    Of course only without [R], this was my fault. (See my question edit for another question please).

提交回复
热议问题