Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

main Domain to subdomain

Status
Not open for further replies.

BrasilianGuy

IS-IT--Management
Oct 27, 2005
25
US
I have a app hoted on a rails server

my application - lwi - is under the rails folder and in the public_html I have lwi folder as well.

the only way to access my app right now is through
but I want my link to be
I assume that i have to do a redirect from =>
I have .htaccess in the public_html and in the lwi folder

How do I make my url and redirect to be
thanks

Ps.: here is the tutorial the hosting company gave me....
I could not get it to work
 

According to the docs, /public_html is the doc root,
so edit /public_html/index.html.

/home would be /public_html/home

eugene
 
It works but check out what is happening with the url

finds the index.html file with the metarefresh then metarerhesh goes to
but if we click on the links it shows
here is my mod_rewrite

# Hostmonster.com
# .htaccess main domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.

# Do not change this line.

RewriteEngine on

# Change yourdomain.com to be your main domain.

RewriteCond %{HTTP_HOST} ^(
# Change 'subfolder' to be the folder you will use for your main domain.

RewriteCond %{REQUEST_URI} !^/lwi/

# Don't change this line.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Change 'subfolder' to be the folder you will use for your main domain.

RewriteRule ^(.*)$ /lwi/$1

# Change yourdomain.com to be your main domain again.
# Change 'subfolder' to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.

RewriteCond %{HTTP_HOST} ^(RewriteRule ^(/)?$ lwi/index [L]
 
Ok...

I feixed the redirection... it was a route problem

My htaccess looks like this

# Hostmonster.com
# .htaccess main domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.


# Do not change this line.

RewriteEngine on


# Change yourdomain.com to be your main domain.

RewriteCond %{HTTP_HOST} ^(

# Change 'subfolder' to be the folder you will use for your main domain.

RewriteCond %{REQUEST_URI} !^/lwi/

# Don't change this line.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Change 'subfolder' to be the folder you will use for your main domain.

RewriteRule ^(.*)$ /lwi/$1

# Change yourdomain.com to be your main domain again.
# Change 'subfolder' to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.

RewriteCond %{HTTP_HOST} ^(RewriteRule ^(/)?$ lwi/home [L]


the only thing now is that the url shows lwi

if you guys want to check it out...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top