'Writing htaccess that points to a file in the sub-directory

I have a order page in the following path

https://example.com/backend/web/order

And I want to display it as

https://example.com/order

What should be the htaccess code (please let me know of every step if possible so I can learn also). Where should I place the htaccess file? Inside the backend folder or the root folder.



Solution 1:[1]

To change https://example.com/backend/web/order to https://example.com/order you can use the following rule in htaccess in your root folder :

RewriteEngine On

RewriteRule ^order /back-end/web/order [L]

The rule above makes it possible to access your old URL as http://example.com/order .

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Amit Verma