FreePgs.com Forum
October 25, 2021, 06:46:31 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Click Here for Toll-Free Service for your business starting at $2.00 per month and 4.5 cents per minute
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: subdomain and .htaccess  (Read 5076 times)
geminigeek
Verified Account
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 20

Blog entries (0)

View Profile WWW
« on: February 02, 2006, 04:18:30 AM »

my webhost kept on going down and i plan to switch to freepgs soon.

so anyway, on my current site, i am using blog.geminigeek.com. How do i redirect my visitor from blog.geminigeek.com to geminigeek.com/blog? And yea, I want the address on the browser change too. i know we can use .htaccess to do this, but im not sure how.

And, is it possible to redirect any directory under blog.geminigeek.com to geminigeek.com/blog?

thanks in advance.
Logged
webzone (archived)
Official Technical Support
Verified Account
Hero Member
*

Karma: +0/-0
Offline Offline

Posts: 508

Archived Account

Blog entries (0)

View Profile
« Reply #1 on: February 02, 2006, 10:16:33 PM »

If you have a directory dedicated to blog.geminigeek.com, then add this line to .htaccess :

Redirect permanent / http://geminigeek.com/blog/
Logged
FreePgs.com Forum
« Reply #1 on: February 02, 2006, 10:16:33 PM »

 Logged
GP™
Technical Support
Hero Member
*****

Karma: +16/-0
Offline Offline

Posts: 874


Wondermous

Blog entries (0)

View Profile WWW
« Reply #2 on: February 03, 2006, 12:37:46 AM »

Not sure if this can be done via htaccess... but i'm not a expert on apache or htaccess...

I do know we can set up (Two) 2 subdomains on your account if you want that to be pointed to /blog

L8r.
Gordon
Logged
geminigeek
Verified Account
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 20

Blog entries (0)

View Profile WWW
« Reply #3 on: February 03, 2006, 07:22:12 AM »

If you have a directory dedicated to blog.geminigeek.com, then add this line to .htaccess :

Redirect permanent / http://geminigeek.com/blog/

i tried putting that code in my .htaccess in my /blog directory, but it doesnt seem to work. it messes up everything. that code redirect my site to infinite number of /blog. is it because the default code generated by my wordpress messes up everything?
Logged
FreePgs.com Forum
« Reply #3 on: February 03, 2006, 07:22:12 AM »

 Logged
x
Verified Account
Full Member
*

Karma: +0/-0
Offline Offline

Posts: 109

Blog entries (0)

View Profile
« Reply #4 on: February 03, 2006, 09:34:45 AM »

I think this will work


Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog.geminigeek.com
RewriteRule ^.*$ http://geminigeek.com/blog [R=301,nc]
Logged
webzone (archived)
Official Technical Support
Verified Account
Hero Member
*

Karma: +0/-0
Offline Offline

Posts: 508

Archived Account

Blog entries (0)

View Profile
« Reply #5 on: February 03, 2006, 07:43:31 PM »

Quote from: geminigeek
i tried putting that code in my .htaccess in my /blog directory, but it doesnt seem to work. it messes up everything. that code redirect my site to infinite number of /blog. is it because the default code generated by my wordpress messes up everything?

Check that wordpress has the correct "WordPress URI" its options section. If that doesn't fix the problem, it is probably because blog.geminigeek.com and /blog point to the same directory.

Quote from: x
I think this will work

Would need some changes, as it might break WordPress. Plus, it will redirect people from a specific article on the subdomain to the homepage. Just to be safe, the corrected code is below.

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^blog.geminigeek.com$
RewriteRule ^(.*)$ http://geminigeek.com/blog/$1 [L,R=301]
Logged
sinex
Verified Account
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4

Blog entries (0)

View Profile
« Reply #6 on: July 26, 2006, 05:53:39 PM »

For 2 subdomains:
Do we have to repeat the 3 lines of the .htacces on main directory, in one file?
like that:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?aranjosflorais.net$
RewriteRule ^(aranjosflorais\/)?(.*)$ aranjosflorais/$2 [L]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?ateliermariasantos.net$
RewriteRule ^(ateliermariasantos\/)?(.*)$ ateliermariasantos/$2 [L]

YES?
And of course proper normal .htaccess in each directory.
Like that we can have 3 domains on one account
Thanks to answer
Logged
brainiac744
Verified Account
Sr. Member
*

Karma: +10/-0
Offline Offline

Posts: 403

Blog entries (0)

View Profile
« Reply #7 on: July 26, 2006, 10:45:58 PM »

You only need "RewriteEngine On" once. The other two lines you repeat for each subdomain.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!