.htaccess RewriteRule for Flat Links

后端 未结 2 915
囚心锁ツ
囚心锁ツ 2020-12-22 04:34

I am pretty new to using the RewriteRule, so I am likely missing something obvious, but I have a PHP script that takes URL variables like this:

{baseurl}prop         


        
相关标签:
2条回答
  • 2020-12-22 05:13

    At a quick glance, it appears that you forgot to include the dash in your regular expression and you included trailing slash. Use this instead:

    RewriteRule ^properties/([0-9A-Za-z-]+)$ /properties.php?prop=$1
    
    0 讨论(0)
  • 2020-12-22 05:25

    If you look at your rule ^properties/([0-9A-Za-z]+)/$ you see that it needs to end with a forward slash. You can either remove that or make it optional like ^properties/([0-9A-Za-z]+)/?$.

    0 讨论(0)
提交回复
热议问题