javascript - how to redirect my /old/folder to /newfolder in htaccess

528

I need to redirect an URL of my website. In fact, how to redirect my/old/folder to/newfolder in htaccess

RedirectMatch 301 ^//old/folder. https://website.com/newFolder/

I used this code :

RedirectMatch 301 ^//old/folder https://website.com/newFolder/

It shows an error 404!

967

Answer

Solution:

This will redirect any file.

RedirectMatch 301 ^/old/folder/(.*)$ https://website.com/newFolder/$1

People are also looking for solutions to the problem: wordpress - date_format() in PHP not returning the formatted date

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.