How to convert dynamic URL to static URL

in order to convert dynamic url to static url, you'll need mod_rewrite module and .htaccess file if your website is hosted in apache server.

Sample Dynamic URL: http://yourdomain.com/product.php?categoryid=1&productid=10

Single Page URL
Generated URL: http://yourdomain.com/product-categoryid-1-productid-10.htm
.htaccess code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule product-categoryid-(.*)-productid-(.*)\.htm$ product.php?categoryid=$1&productid=$2

Directory Type URL
Generated URL: http://yourdomain.com/product/categoryid/1/productid/10/
.htaccess code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule product/categoryid/(.*)/productid/(.*) product.php?categoryid=$1&productid=$2
RewriteRule product/categoryid/(.*)/productid/(.*)/ product.php?categoryid=$1&productid=$2

Was this answer helpful?

Also Read

Failed to upload image or file to wordpress

Issue:There will be possibilities where you will not be able to upload any images or files to...

How do I block an IP address from accessing my site?

If you wish to ban a user from accessing your website in any way, the best way to do this is to...

Turn On/Off Directory Browsing

For Linux server: Turn on Directory Browsing -create a .htaccess file in the specific directory...

How to enable compression on website?

Issue: When you check your website using http header tools you can see that your website is not...