I want to set a URL for woocomerce my account page.

The default one is www.sitename.com/my-account

I want a URL for eg: www.sitename.com/page should redirect to www.sitename.com/my-account

I tried using .htaccess

RewriteEngine on
RewriteRule  ^page/?$ myaccount/my-account.php  [NC,L]

But does't work. What is wrong in this ?

Another easy way is to create a page and in that page just redirect to my account page. But I thought of doing through .htaccess

1 Answers

Matt On

In your question you say you want to redirect from a subfolder to another subfolder but your code shows that you're redirecting from a subfolder to a php page and that php page doesn't exist in woocommerce's default structure (there is no valid /my-account.php but there is a /my-account).

If you're trying to redirect everything from /page to /myaccount just use:

RewriteEngine on
RewriteRule ^/?page/(.*)$ my-account/$1 [R=301,L]

or is you want to do a simple redirect from just one subfolder to another, do this:

Redirect 301 /page /my-account