pretty url with .htaccess?

前端 未结 3 702
温柔的废话
温柔的废话 2021-01-29 10:09

i just created a new wordpress page template that runs some php&mysql scripts inside it and i would like to apply mod rewrite to it\'s subpages.

for instance i have

3条回答
  •  渐次进展
    2021-01-29 10:41

    You'll have to add the following to your .htaccess file:

    RewriteRule ^(?![^.]+\.html.*)([^/]+)/([^/]+)/([^/]+)/?$ $1.html?$2=$3 [L,QSA]
    

    This won't prettify URLs that don't have all three variables, but that's easy enough to add to this one or simply put in an additional rule if needed.

提交回复
热议问题