Home > Software design >  How to redirect in php project using .htaccess file
How to redirect in php project using .htaccess file

Time:02-10

I want to redirect the urls in PHP as following using .htaccess file.
https://beld.onepa/bood-uddevalla -> https://beld.onepa/bood-uddevalla/
https://beld.onempa/buten-vbras/ -> https://beld.onempa/buten-vbras
How can I describe command in .htaccess

CodePudding user response:

Try this:

Redirect 301 /old/page /new/page

or

Redirect 302 /old/page /new/page

Keep in mind:

A 301 redirect is a status code that tells search engines and users the page has permanently moved.

A 302 redirect is a temporary change that redirects both users and search engines to the desired new location for a limited amount of time, until the redirect is removed.

  • Related