.htaccess - how to hide id from an url using htaccess mod-rewrite? -


I am using this code to rewrite my URL

  RewriteRule ([0 -9] *) - ([^ /] *) \. Html $ index.php? Menu_id = $ 1 and menu = $ 2 [qsappend]  

This again writes my URL:

  www.site.com/1- Home.html  

where 1 is id (menu_id) and the name of the home menu.

I am looking for a solution where I would like to rewrite the URL:

  www.site  

"post-text" itemprop = "text">

Here's how.

  Rewrite rules ([^ /] +). Html $ index.php? Menu_id = 1 & amp; Menu = $ 1 [qsappend]  

Edit: You must compensate for the fact that you do not know Menu ID. For example I put a 1 there, BC I think you want all your menu IDs to be one.

Your code here is broken:

  # This is where your ID code is located in #. This is a dash in your code. | This is your home part # v v v rewriterule ([0-9] *) - ([^ /] *). Html $ index.php? Menu_id = $ 1 and menu = $ 2 [qsappend] # | _____________________ | | __________________________ | # Revue script # www.site.com/1-home.html  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

c# - Create dynamic LINQ query expression at runtime which translates into a parameterized SQL query for nullable types -

cmake - cpack generates RPMs with %files entries that conflict with the RPM spec. How to fix? -