Simple .htaccess rewrite to pass 1 parameter

后端 未结 3 1475
独厮守ぢ
独厮守ぢ 2020-12-19 17:43

Can someone please tell me what should my .htaccess file contain to create the following rewrite:

http://www.example.com/success

to call

3条回答
  •  -上瘾入骨i
    2020-12-19 18:17

    Following code I use for my site

    RewriteEngine On
    
    RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?q=$1
    
    RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?q=$1
    

    or you can write following

    RewriteEngine On
    
    RewriteRule ^(.+)$ index.php?q=$1
    
    RewriteRule ^(.+)/$ index.php?q=$1
    

提交回复
热议问题