vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   .htaccess-redirecting a subforum question (https://vborg.vbsupport.ru/showthread.php?t=214839)

RichieBoy67 05-29-2009 12:22 PM

.htaccess-redirecting a subforum question
 
Hey all, I hope someone can help me with this..

I just removed a sub domain from a site and I want to redirect the sub domain's path to the root directory....

This is what I came up with but it doesn't seem to be working. What am I missing?

RewriteCond %{HTTP_HOST} subdomain.mysite.com
RewriteCond %{REQUEST_URI} !mysite.com/
RewriteRule ^(.*)$ mysite.com/$1 [L]

Thank you guys so much,

Rich

UKBusinessLive 05-29-2009 12:52 PM

Quote:

Originally Posted by RichieBoy67 (Post 1819466)
Hey all, I hope someone can help me with this..

I just removed a sub domain from a site and I want to redirect the sub domain's path to the root directory....

This is what I came up with but it doesn't seem to be working. What am I missing?

RewriteCond %{HTTP_HOST} subdomain.mysite.com
RewriteCond %{REQUEST_URI} !mysite.com/
RewriteRule ^(.*)$ mysite.com/$1 [L]

Thank you guys so much,

Rich

Hi Rich In .htaccess files to use the rewrite condition you need to add above it

Code:

ReWriteEngine On
Give that a go, but it it don't work, try the code i've done below instead, let me know mate

Code:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?subdomain.mysite.com$ [NC]
RewriteRule ^same/(.*) http://$1.mysite.com[R=301,L]

:up:

RichieBoy67 05-29-2009 01:16 PM

Thanks,

yeah, I actually already have that.. sorry I didn't show it here but I will try everything else you changed..

Thank you so much Mr UK!!

UKBusinessLive 05-29-2009 01:18 PM

Quote:

Originally Posted by RichieBoy67 (Post 1819517)
Thanks,

yeah, I actually already have that.. sorry I didn't show it here but I will try everything else you changed..

Thank you so much Mr UK!!

No worries let me know if that works or not sometimes .htaccess codes can clash dependant what else you have in it.

:D;)

RichieBoy67 05-29-2009 11:23 PM

Thanks--It didn't work actually so I created a simple page with a meta redirect for now. I believe it probably is because of other items on the htaccess file. I will post them when I have a chance. I appreciate your advice and help.

Thanks


All times are GMT. The time now is 11:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01093 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete