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

How to disable IPv6 on Centos

There are times where you might need to disable IPv6 on your Centos Server. Below are the options...

How do I configure a cron job?

Login to cPanel. Locate and click on the "Cron Jobs" icon under the "Advanced" category. Fill...

How much hosting do I need?

If you are starting your first website, chances are you are not familiar with common hosting...

How to configure authentication email by using cPanel

First, you need to login the cPanel page. In the Mail section, click Authentication.   Domain...

I've updated my website, but still see the old version. What's going on?

You must Refresh your browser. Your computer holds a copy of your website in 'cache'. Things to...