Mark Rummel
Mark Rummel

Reputation: 2940

htaccess: Redirect vs. Redirect 301

I was just looking in one of my .htaccess files and noticed the following:

Redirect /old-page /new-page

I was expecting to see Redirect 301 or Redirect 302, but it only said Redirect and works just fine.

I'm curios if 301 or 302 isn't indicated what does the redirect default to? 301? 302? Something else?

Upvotes: 1

Views: 47

Answers (1)

anubhava
anubhava

Reputation: 785008

This line:

Redirect /old-page /new-page

Means use 302 since 302 is default value here.

To use 301:

Redirect 301 /old-page /new-page

See 301 directive documentation

Upvotes: 1

Related Questions