Jump to content

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
https://forums.phpfreaks.com/topic/194828-quick-redirect/
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
https://forums.phpfreaks.com/topic/194828-quick-redirect/#findComment-1024444
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
https://forums.phpfreaks.com/topic/194828-quick-redirect/#findComment-1024475
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
https://forums.phpfreaks.com/topic/194828-quick-redirect/#findComment-1024493
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
https://forums.phpfreaks.com/topic/194828-quick-redirect/#findComment-1024499
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

Link to comment
https://forums.phpfreaks.com/topic/194828-quick-redirect/#findComment-1024507
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
https://forums.phpfreaks.com/topic/194828-quick-redirect/#findComment-1024520
Share on other sites

You may need to set RewriteLogLevel too.

 

Or your host may be forbidding it.

 

Just tried that.. I'm pretty sure they blocked it..

 

I was just reading their FAQ and I saw something that they were running in "CGI Mode"...

Link to comment
https://forums.phpfreaks.com/topic/194828-quick-redirect/#findComment-1024529
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.