Creating dynamic file in php (not the title) -


What do I do:

Create a dynamic php file for each product What I'm currently doing If someone clicks on a product, it opens with some data in the same file ie. www.example.com/showproduct.php?ref=1085 . Here is a 1085 productive & amp; Thus it shows the content from DB to the special ID.

Is it possible to show URLs as www.example.com/google-nexus-5-16gb-black.php , where does this data come from DB content?

I do not want to create a page for each product, I think it will be garbage, is there a solution? You can also show the URL for each question on stackoverflow .

Edit

I have used the following code in the .htaccess file, still do not write this URL again Used to be.

  Rev. Rev. / Referee ([AZA-J 0-9 -] +) /? $ Showproduct.php? Ref = $ 1 [nc]   

Is there a problem with this? And I have my db & amp; Once I know how it works, get the file name. Unique For each product record in your DB, you have a unique

mod_rewrite from the map www.example.com/YOUR-ALIAS to www.examplecom / showproduct.php? Aka = YOUR-ALIAS . This will give your desired friendly URL effect.

Update

In your case it appears that you only google-nexus- 5-16gb-black.php to showproduct.php ? Ref = 1085 , may be more and more on creating an additional nickname field In this case, you can set a single rewrite rule:

  ^ at google-nexus ^ RewriteRule ^ RewriteEngine -5-16gb-black.php $ /showproduct.php?ref=1085 [L]    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -