Klaus
Klaus

Reputation: 11

Redirect single HTTP URL to HTTPS via .htaccess

I created a new website. The old one used http and the new one uses https and has a a different URL path.

Example:

OLD: website.com/index.php/powerpoint-presentation

NEW: https://website.com/powerpoint-presentation

How do I direct a single URL in .htaccess this way? I would like to do around 10 manual 301 redirections.

Upvotes: 1

Views: 27

Answers (2)

oTradeMark
oTradeMark

Reputation: 66

Single redirects can be done like Dave mentioned:

Redirect 301 /index.php/powerpoint-presentation https://website.com/powerpoint-presentation

But if all of your old URL's are structured the same way and you just want to remove the /index.php/ you could do this:

RewriteEngine On
RewriteRule ^index\.php/(.*)$ https://website.com/$1 [R=301,L]

This would redirect any URL's with the old /index.php/ structure to the same URL on the https:// website without the /index.php/

Upvotes: 0

Dave
Dave

Reputation: 5191

On the old web site in your .htaccess file you would use something like this:

Redirect 301 /index.php/powerpoint-presentation https://website.com/powerpoint-presentation

You may of course use as many as you need to.

Upvotes: 1

Related Questions