Web Hosting Forum | Lunarpages
News: July 14, 2008 - New Contest! - Submit Your WordPress Theme Designs, Win BIG!
August 25, 2008 - Time to Vote for the August 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 29, 2008, 09:15:31 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: How to point an adon domain or a subdomain to subfolder of second level?  (Read 1800 times)
jureb
Newbie
*
Offline Offline

Posts: 5


« on: May 14, 2008, 01:59:11 AM »

I'm setting up some domains and subdomains on my basic hosting plan and I'm wondering if it is possible to point an adondomain or a subdomain to a subfolder of a second level (root_folder/subfolder/folder_to_which_subdomain_points)?

I've heard it could be possible by .htaccess, but have no idea how. Does anybody know it.
« Last Edit: May 14, 2008, 08:23:53 AM by jureb » Logged
jureb
Newbie
*
Offline Offline

Posts: 5


« Reply #1 on: May 15, 2008, 08:27:04 AM »

No ideas !? Please help me  Confused
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3237



« Reply #2 on: May 15, 2008, 01:00:10 PM »

Don't try using the cPanel Redirect function to do this, as it will trip up on subdomains and add-on domains. You'll have to manually edit your .htaccess files (one in each subdomain or add-on domain root directory).

RewriteEngine On
RewriteCond  %{REQUEST_URI}  !^/second_level
RewriteRule  ^(.*)$  /second_level/$1  [L]


Something like that (I'm working off the top of my head on about 3 hours sleep). The idea is, once control is in the root directory of the subdomain or add-on domain, you exclude cases where you're already starting at the second level, and redirect to second level+original request. It may require some tweaking, but it should be close to that. If you want the visitor to see the new address in their browser, replace [L] with [R=301,L].
Logged

jureb
Newbie
*
Offline Offline

Posts: 5


« Reply #3 on: May 16, 2008, 03:21:43 PM »

Thanks a lot it helped me!

I also used some help here: http://corz.org/serv/tricks/htaccess2.php

JureB
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM