Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Change default web directory?
Old 06-15-2008, 11:36 PM Change default web directory?
freki's Avatar
Super Talker

Posts: 110
Name: Cody
Trades: 0
Hey how do you change the default web directory for a visitor? I want the visitor to see example.com/main when they type in example.com instead of the default "public_html". Thanks all!
__________________
Get to know the real me -
Please login or register to view this content. Registration is FREE
freki is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-16-2008, 02:49 AM Re: Change default web directory?
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
First, if you have shell access to the server and it's linux can you create a symbolic link (move the current contents to a new folder in the same directory as public_html named html for example, delete public_html, then create a 'new' public_html that is actually a symbolic link to it {a symbolic link would be called a shortcut in windows}).
Second, if it's Apache: http://httpd.apache.org/docs/1.3/mod/mod_alias.html
Code:
Redirect / http://example.com/main
That will give you a temporary (302) redirect code, if you want it to be permament use Redirect permament instead. Or use seeother instead (303) to indicate something has been replaced.
If nothing else you can try mod_rewrite:
Code:
RewriteRule ^/(.*) /main$1
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Reply     « Reply to Change default web directory?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09869 seconds with 12 queries