Recursive mod_rewrite for search engine friendly urls

前端 未结 4 1075
别那么骄傲
别那么骄傲 2020-12-30 18:11

I\'ve been reading through a previous solution to a recursive mod_rewrite problem that is similar to what I\'m trying to do, the difference is I\'m sending all queries throu

4条回答
  •  清歌不尽
    2020-12-30 18:25

    I understand this is a very old thread. But since none of the answers posted here worked for me and I want to post my answer so that visitors can use it if they want so I am answering it here:

    Options +FollowSymlinks -MultiViews
    RewriteEngine on
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/]+)/([^/]+)(/.*)?$ $3?$1=$2 [N,QSA,DPI]
    RewriteRule ^(/[^/]+|[^/]+/|/?)$ /index.php [L,QSA,DPI]
    

    For more details please see my answer on MOD_REWRITE for URL variables, removing empty parameters and using more than 1field for the first and second variables

提交回复
热议问题