Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-23-2011, 03:56 PM   PM User | #1
PeterParker
New to the CF scene

 
Join Date: Jun 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
PeterParker is an unknown quantity at this point
redirect using htaccess only redirects homepage

Hi,

Just used some coding to redirect http to https, but it only works on the homepage. When I click on a link to another page on the website it's showing a 404. How can I redirect the entire site to https properly?
PeterParker is offline   Reply With Quote
Old 06-25-2011, 03:32 PM   PM User | #2
techlib
New to the CF scene

 
Join Date: May 2011
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
techlib is an unknown quantity at this point
Try this
Code:
<IfModule mod_rewrite.c>
Options +FollowSymLinks 
RewriteEngine on 

#	Redirecting http to https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.mydomain.com/ [R=301,L]
</IfModule>
techlib is offline   Reply With Quote
Users who have thanked techlib for this post:
PeterParker (06-30-2011)
Old 06-26-2011, 09:04 PM   PM User | #3
PeterParker
New to the CF scene

 
Join Date: Jun 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
PeterParker is an unknown quantity at this point
hi Teclib,

Sorry, forgot to tell you that it's a wordpress site.
I tried your code, but probably because of wp it didn't work.

I'm still having the 404 problem.
PeterParker is offline   Reply With Quote
Old 06-30-2011, 09:27 PM   PM User | #4
PeterParker
New to the CF scene

 
Join Date: Jun 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
PeterParker is an unknown quantity at this point
Problem solved, guys. It was a setting I had to change within WP.
PeterParker is offline   Reply With Quote
Old 08-10-2011, 08:23 AM   PM User | #5
remshad
New Coder

 
Join Date: Apr 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
remshad is an unknown quantity at this point
hi techlib,

can you please say how to write .htaccess for redirecting my whole site into another domain
__________________
computer science || Seminar And Projects
remshad is offline   Reply With Quote
Reply

Bookmarks

Tags
htaccess, http, https, ssl

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:33 AM.


Advertisement
Log in to turn off these ads.