tread
tread

Reputation: 11108

Redirect only domain.com to a subfolder?

Hi i would like to redirect only the domain.com (not www.domain.com) to a subfolder

I tried:

RewriteCond %{HTTP_HOST} ^?YourDomain.com$
RewriteRule ^(/)?$ page [L]

but it gave an internal server error

Upvotes: 0

Views: 41

Answers (1)

Jon Lin
Jon Lin

Reputation: 143946

The 500 internal server error is caused by a bad expression:

# what's this? -----------v
RewriteCond %{HTTP_HOST} ^?YourDomain.com$

Not sure what you're trying to do with that question mark. But you probably want something like this:

RewriteCond %{HTTP_HOST} ^YourDomain.com$ [NC]

The [NC] makes it case insensitive.

Upvotes: 1

Related Questions