Htaccess Remove part of URL

后端 未结 2 405
忘掉有多难
忘掉有多难 2021-01-27 20:19

I have this URL: http://www.website.nl/pagina/4/wie-ben-ik.html

\"pagina\" is a real php document. \"4\" is the id of the webpage, with the id I get the results from the

2条回答
  •  青春惊慌失措
    2021-01-27 20:42

    You have to pass the id some way or the other if you want it to query from the database.

    Either use a query string (name-value pair) or have it in the URI like your are doing above.

    If you do not want pagina in your URI you can have your URI's like this: http://www.website.nl/wie-ben-ik/

    RewriteCond %{REQUEST_URI} ^/(wie-ben-ik)/(\d+)
    RewriteRule ^ /pagina/%2/%1\.html
    

提交回复
热议问题