0

How to use .htaccess to rewrite the all URL of .php to / under the folder /hkcompany/

Before rewrite:

www.domain.com/hkcompany/search.php?typeid=1&crno=F1234&name=ABC+Company+有限公司

There are 3 variables for the php url

After rewrite:

www.domain.com/hkcompany/1/F1234/ABC+Company+有限公司

It may be look like:

RewriteEngine On
RewriteRule ^hkcompany/(.*)/(.*)/(.*)/?$  hkcompany/search.php?typeid=$1&crno=$2&name=$3

Thank you for help & support !

  • 1
    What error do you get with the rule you have tried? – Amit Verma Jan 10 '22 at 15:36
  • 1
    You described what you want to achieve, but not what you actual issue is. We cannot somehow guess that. So you need to tell us ... – arkascha Jan 10 '22 at 16:52
  • Does this answer your question? [URL rewriting with PHP](https://stackoverflow.com/questions/16388959/url-rewriting-with-php) – pringi Jan 11 '22 at 09:51

0 Answers0