Hello everyone,How can i change the url when I am navigating from one page to another. for example if the existing url is like "www.example.com/product.php?name=xyz&q=service" ,I want to change it to "www.example.com/product/name/xyz/q/service" But I dont want to use .htacces. How can I do it using php functions only?
You need to be able to do some sort of rewriting to force all requests through a single file. From there, you can use php as a controller however you like. The problem with "/product/name/xyz/q/service" is that is would be interpreted as directories and a file without an extension. a rewrite would be required to prevent this from happening.
I think you can't do it (correct me if I'm wrong). The web server is responsible for the rewrites and the .htaccess is the file from which the server "knows" how to interpret different HTTP file requests.