Jump to content

Quick redirect?


Cory94bailly

Recommended Posts

Hi.

 

I am trying to make it so these rules are followed:

MYSITE.net/WHATEVER > MYSITE.net/_forum/WHATEVER (Note: I want it to show as MYSITE.net but be at /_forum)
forum.MYSITE.net/WHATEVER > MYSITE.net/WHATEVER
blog.MYSITE.net/WHATEVER > MYSITE.net/STATIC-PAGE

 

 

Everything I have tried just gave me a 500 error..

 

Any help?

Link to comment
Share on other sites

This might do it:

 

RewriteEngine on

#MYSITE.net/WHATEVER > MYSITE.net/_forum/WHATEVER (Note: I want it to show as MYSITE.net but be at /_forum)
#forum.MYSITE.net/WHATEVER > MYSITE.net/WHATEVER
RewriteCond %{HTTP_HOST} ^MYSITE\.net
RewriteCond %{HTTP_HOST} ^forum\.MYSITE\.net [OR]
RewriteRule (.*) _forum/$1 [QSA,L]

#blog.MYSITE.net/WHATEVER > MYSITE.net/STATIC-PAGE
RewriteCond %{HTTP_HOST} blog\.MYSITE\.net
RewriteRule .* STATIC-PAGE [L]

Link to comment
Share on other sites

This might do it:

 

RewriteEngine on

#MYSITE.net/WHATEVER > MYSITE.net/_forum/WHATEVER (Note: I want it to show as MYSITE.net but be at /_forum)
#forum.MYSITE.net/WHATEVER > MYSITE.net/WHATEVER
RewriteCond %{HTTP_HOST} ^MYSITE\.net
RewriteCond %{HTTP_HOST} ^forum\.MYSITE\.net [OR]
RewriteRule (.*) _forum/$1 [QSA,L]

#blog.MYSITE.net/WHATEVER > MYSITE.net/STATIC-PAGE
RewriteCond %{HTTP_HOST} blog\.MYSITE\.net
RewriteRule .* STATIC-PAGE [L]

 

Ok.. So when I go to MYSITE.net, it works like it should..

 

But when I go to forum.MYSITE.net, it does nothing.. It just keeps me on forum.MYSITE.net..

 

And how can I make it so blog.MYSITE.net redirects to MYSITE.net? I tried putting it right it but it gave me a 500.

Link to comment
Share on other sites

Oops. I have the [OR] on the wrong line.

 

RewriteEngine on

#MYSITE.net/WHATEVER > MYSITE.net/_forum/WHATEVER (Note: I want it to show as MYSITE.net but be at /_forum)
#forum.MYSITE.net/WHATEVER > MYSITE.net/WHATEVER
RewriteCond %{HTTP_HOST} ^MYSITE\.net [OR]
RewriteCond %{HTTP_HOST} ^forum\.MYSITE\.net
RewriteRule (.*) _forum/$1 [QSA,L]

 

I'm not sure what you want with the blog.MYSITE.net anymore.  If you redirect from blog.MYSITE.net to MYSITE.NET it's going to redirect again to _forum.  Is that what you want?

Link to comment
Share on other sites

Oops. I have the [OR] on the wrong line.

 

RewriteEngine on

#MYSITE.net/WHATEVER > MYSITE.net/_forum/WHATEVER (Note: I want it to show as MYSITE.net but be at /_forum)
#forum.MYSITE.net/WHATEVER > MYSITE.net/WHATEVER
RewriteCond %{HTTP_HOST} ^MYSITE\.net [OR]
RewriteCond %{HTTP_HOST} ^forum\.MYSITE\.net
RewriteRule (.*) _forum/$1 [QSA,L]

 

I'm not sure what you want with the blog.MYSITE.net anymore.  If you redirect from blog.MYSITE.net to MYSITE.NET it's going to redirect again to _forum.  Is that what you want?

 

Yes, that's what I do want it to do..

 

Hmm, I'm not sure what I changed but the blog redirect works now..

 

Now it's just that "forum.MYSITE.net" doesn't redirect me anywhere (still)..

 

I'm trying 2 different browsers and I cleared my cache on both. (And I just tried a proxy)

Link to comment
Share on other sites

I'm not really sure why the forum.MYSITE.net redirect wouldn't be working.

 

My RewriteCond lines essentially say if the host is "MYSITE.net" or "forum.MYSITE.net" then redirect to "_forum"

 

You might try some logging.

 

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritelog

 

I tried putting this in my .htaccess:

RewriteLog "/home/moddlnet/public_html/rewrite.log"

 

But it gave a 500.. (I tried putting it at the top and at the bottom.. both 500.)

 

I'm on shared hosting btw..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.