Redirect Old URL to New URL open cart using htaccess

512 views Asked by At

I want to redirect 301 old url to new url.

my old url is;

http://www.domainname.com/special

and new url is;

http://www.domainname.com/offers

I tried this code:

redirect 301 /http://www.domainname.com/special http://www.domainname.com/offers

But still now it's not redirecting & taking me to the old URL which does'nt exist.

2

There are 2 answers

0
AudioBubble On

There are various ways to do this and various redirects, I've listed them below:

301 (Permanent) Redirect: Point an entire site to a different URL on a permanent basis. This is the most common type of redirect and is useful in most situations. In this example, we are redirecting to the "example.com" domain:

This allows you to redirect your entire website to any other domain

Redirect 301 / http://example.com/

302 (Temporary) Redirect: Point an entire site to a different temporary URL. This is useful for SEO purposes when you have a temporary landing page and plan to switch back to your main landing page at a later date:

This allows you to redirect your entire website to any other domain

Redirect 302 / http://example.com/

Redirect index.html to a specific subfolder:

This allows you to redirect index.html to a specific subfolder

Redirect /index.html http://example.com/newdirectory/

Redirect an old file to a new file path:

Redirect old file path to new file path

Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html

Redirect to a specific index page:

Provide Specific Index Page (Set the default handler)

DirectoryIndex index.html
0
Amit Verma On

Try this :

Redirect 301 /special /offers

Second argument of Redirect Directive is the URL Path, it doesn't start with Scheme and hostname.