parked domain mod_rewrite

  • Shrek_Update
  • Student
  • Student
  • User avatar
  • Posts: 73

Post 3+ Months Ago

hi everyone,

i have the following problem.

I have parked a domain but would like it to point to a folder with its name similar to addon domain.

I use the following .htaccess :

Code: [ Select ]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.com
RewriteRule ^$ http://www.mymainsite.com/mysite/$1 [L]
  1. RewriteEngine On
  2. RewriteCond %{HTTP_HOST} ^mysite.com [OR]
  3. RewriteCond %{HTTP_HOST} ^www.mysite.com
  4. RewriteRule ^$ http://www.mymainsite.com/mysite/$1 [L]


This works perfectly when in the browser i enter mysite.com

But when i enter mysite.com/folder it REDIRECTS me to mymainsite.com/folder - while i want to rewrite to mymainsite.com/mysite/folder

What am i doing wrong? how to make it right?

Any ideas will be highly appreciated.

Thank you in advance.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

Try;

Code: [ Select ]
RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]
RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
RewriteRule ^(.*)$ http://www.mymainsite.com/mysite/$1 [L]
  1. RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]
  2. RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
  3. RewriteRule ^(.*)$ http://www.mymainsite.com/mysite/$1 [L]


Try That.

Though I have to wonder, if you have the domain, and the domain delivers different content, why would you not either virtual host the second domain on the same IP (easy to do with Apache)?
Are you a domain squatter?
I fail to understand why you would want a rewrite rule instead of name-based virtual hosting.

Cheers.
  • Shrek_Update
  • Student
  • Student
  • User avatar
  • Posts: 73

Post 3+ Months Ago

still no luck, i guess virtual host will work better.

Quote:
Are you a domain squatter?

no, both domains are mine.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 27 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.