forwarding domain, but not subdomain

Is it possible to forward http://www.mydomain.com, but not http://www.mydomain.com/page/

thanks!

3 Replies

That's not a sub-domain, that's a page within your domain.

example.com = domain

www.example.com = sub-domain of example.com (most people have www.example.com and example.com point to the same place but they don't have to)

photos.example.com = sub-domain of example.com

I'm sure what you're asking about could probably be done with URL Rewrite rules, but I'm not sure what those would look like.

@waldo:

That's not a sub-domain, that's a page within your domain.

example.com = domain

www.example.com = sub-domain of example.com (most people have www.example.com and example.com point to the same place but they don't have to)

photos.example.com = sub-domain of example.com

I'm sure what you're asking about could probably be done with URL Rewrite rules, but I'm not sure what those would look like.

Good points. Didn't know. Thanks - I'm learning as I go. :-)

If you have PHP, one of the simplest solutions would be to use the following script as index.php

Or, you can put something in an .htaccess file. It would probably look like:

RewriteCond %{request_uri} /
RewriteRule ^(.*)$ http://destination/$1

But it's been a while since I've played with mod_rewrite, so I might be missing something there.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct