iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-20-2006, 05:27 PM
WebProWorld Member
 
Join Date: Oct 2005
Posts: 36
wdillsmith RepRank 0
Default apache rewrite and shared server

Hi-

I'm having a problem figuring out the exact syntax I need to use with apache and rewrite. Here is my scenario. I have two domains registered, and the "parked" one points to my main site. I recently found some people are linking to my parked domain. Further, the parked domain is setup so that is does not currently return a "301 permanent redirect." Instead, it returns a "200" header response, but the actual page from my main site. Thus, it appears as an exact duplicate of my main site. I'd like to fix this to get credit for the backlinks on my main domain, and also to insure I do not get penalized for having 2 sites with the exact same content.

Rather than rely on my hosting company to fix this problem, I decided it would be better for me to just create the proper rules in my .htaccess file. So, here is what I have now:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.myparkeddomain.com$
RewriteRule ^(.*)$ http://www.mymaindomain.com/$1 [R=301]

This works for http. However, when someone tries to buy something on www.mymaindomain.com, they are sent to a completely different server, and the checkout page includes secure image links from my main domain, which uses a shared certificate. So, on the checkout page, you would find a reference like:



When I have the above htaccess file in place, none of the images appear on the checkout page. If I remove the .htaccess file, the images appear.

Any ideas on how to fix? Thanks,

Bill
Reply With Quote
  #2 (permalink)  
Old 11-21-2006, 07:00 PM
incrediblehelp's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Jan 2004
Location: Live in Cincy Now
Posts: 7,573
incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4
Default

I would still email your host and ask them help fix. The code your using looks ok, maybe the host has some rules in place that is disagreeing with your htaccess file when put live?

Here is the code I tend to use:

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
Reply With Quote
  #3 (permalink)  
Old 11-21-2006, 07:29 PM
TrafficProducer's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: United Kingdom
Posts: 1,638
TrafficProducer RepRank 3TrafficProducer RepRank 3
Default Apache Rewrite Links

Apache Rewrite Links here's some links to get you started :-

Apache open-source software and Apache Servers. Mod Rewrite.

Windows Rewrites. Windows Servers. Mod Rewrite

htaccess Files and .htaccess Help. How use to .htaccess
Reply With Quote
  #4 (permalink)  
Old 02-21-2007, 10:58 PM
WebProWorld Member
 
Join Date: Oct 2005
Posts: 36
wdillsmith RepRank 0
Default

Quote:
Originally Posted by incrediblehelp
I would still email your host and ask them help fix. The code your using looks ok, maybe the host has some rules in place that is disagreeing with your htaccess file when put live?

Here is the code I tend to use:

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
I finally got a tech at my hosting company who knew what he was doing, and he fixed up their side. It's working now using the code you had suggested. Thanks for the help.
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:32 PM.



Search Engine Optimization by vBSEO 3.3.0