The website is running on a web hosting where we don't have access on htaccess file.The web server is Apache. I want to rewrite URL. For example: The original URL: www.mydomainname.com/en/piecework/piecework.php?piecework_id=11 Expected URL:piecework.mydomainname.com/en/11

How to do it?

This cannot be done in PHP, you will need to edit a htaccess file and use RewriteRules in there.

Suppose I can use mod_rewrite, how to achieve this?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.