Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have two domains www.domain1.com and www.domain2.com, both pointing to the same host. What I want to do is redirect www.domain2.com to www.domain1.com/domain2.

I got this code for a .htaccess from the hosting provider but is giving me a error "500 Internal Server Error" when I install it. What is the problem?

RewriteEngine On
RewriteCond% {HTTP_HOST} ^ [www.] domain1.com $ [NC]
RewriteCond% {REQUEST_URI}! ^ / domain2 / .*
^(.*) RewriteRule / index / $ 1 [L]
share|improve this question
    
This looks like a server configuration issue to me. Please consider using serverfault.com or another community to ask the question as it is not specific to wordpress. –  hakre Dec 24 '10 at 2:24
    
for starters remove the spaces in your .htaccess lines –  edelwater Dec 24 '10 at 3:29
add comment

2 Answers

up vote 2 down vote accepted

What I want to do is redirect www.domain2.com to www.domain1.com/domain2.

Then you don't want to do it via htaccess. You need to use the WordPress MU Domain Mapping plugin.

Map any blog/site on a WordPressMU or WordPress 3.X network to an external domain.


Also see: WordPress 3.0: Multisite Domain Mapping Tutorial

The other day, Klint Finley wrote a very good walkthrough of using the new Multisite functionality of WordPress 3.0. In the comments, a lot of people wanted to know how to use your own domain names. Since I’m doing that now, here’s a quick walkthrough/how-to guide.

share|improve this answer
    
Thanks a bunch andrea_r, works great and no messing with .htaccess –  UXTE Dec 25 '10 at 17:03
    
What i was doing "blog1.sitename.com -> blog1/" will give 500 error, "blog1.sitename.com -> /" point it to root dir –  Ajay Patel Jun 13 '12 at 10:22
add comment

When you get a "500 Internal Server Error" look into the error log of your webserver. There you will find more information what went wrong.

In your case it's most probably a syntax issue with .htaccess directives you wrote. They don't look properly written to me.

For information about mod_rewrite please see Module mod_rewrite URL Rewriting Engine (Apache HTTP Server). There you will find how to write each command, how they work, description of parameters etc.

For more information about the error log, please see Log Files / Error Log (Apache HTTP Server). It contains valuable information what you wrote wrong in the .htaccess file.

share|improve this answer
    
Thanks for the information hakre. This code was sent to me from the host and is supposed to work that's why I came here looking for a quick answer. But I'll have a look into that information . Thanks. –  UXTE Dec 24 '10 at 10:09
    
@Pedro Reis: If the host sended that to you, and you made not error applying it, I would contact them and tell them about the problems you have with it. –  hakre Dec 24 '10 at 10:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.