.htaccess mod_rewrite subdirectory to URL parameter

后端 未结 3 704
日久生厌
日久生厌 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:53

    You need to add a RewriteBase /projects to the htaccess. That way the redirect will work properly.

    Edit:

    RewriteEngine on
    RewriteRule ^index.php - [L]
    RewriteRule ^([^/]+)/?$ index.php?dir=$1 [R,L]
    

提交回复
热议问题