htaccess rewrite redirect with parameters in subfolder

后端 未结 2 760
执念已碎
执念已碎 2021-01-24 10:26

I want that when you go to url: http://www.example.com/subdir/paramvalue

redirects to

http://www.example.com/subdir/index.php?param=paramvalue

My .htacce

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-24 10:50

    Place this rule in subdir/.htaccess (not site root):

    RewriteEngine On
    RewriteBase /subdir/
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .+ index.php?param=$0 [L,QSA]
    

提交回复
热议问题