Ahad Aman
Ahad Aman

Reputation: 138

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.

Upvotes: 0

Views: 47

Answers (1)

Amit Verma
Amit Verma

Reputation: 41229

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 .

Upvotes: 1

Related Questions