Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 25, 2012, 12:17:57 PM

Pages: [1]   Go Down
  Print  
Author Topic: Is it possible to change the default "home" directory for my website?  (Read 830 times)
jmccay
Newbie
*
Offline Offline

Posts: 4


« on: September 09, 2011, 07:41:28 AM »

I have a website hosted at lunarpages and the default home directory for the website is /public_html. I had someone create a new site for me and they put the site in a folder within the /public_html folder. So my question is this:

When someone points their web browser to www.mydomainname.com is there a way to have the home directory be /public_html/subfolder1/subfolder2 instead of public_html.

I realize the other option is move the new site to the public_html directory but then all of the links will be broken.

Thanks in advance.

Logged
Pete
Alien Anomaly
Senior Moderator
Professor in Nanotechnology
*****
Offline Offline

Posts: 4302



WWW
« Reply #1 on: September 09, 2011, 11:03:23 AM »

Hi jmccay    Pete waves

to the Lunarforums   Welcome

I think you should be able to use "redirects" option from your cpanel to acomplish this.
Quoting what it says.."Redirects allow you to make a specific web page redirect to another page and display the contents of that page. This way you can make a page with a long URL accessible by a page which has a shorter and easier to remember URL."
Logged

x-visions.com


As I'm always saying.. (But nobody listens)
"Take a step back.. Take a deep breath and see if there a simple solution there, thats hiding" lol  Very HappyLunarpages Web Hosting   Lunarpages Forums  Lunarpages Affiliate Program
MichaelT
Support
Jabba the Hutt
*****
Offline Offline

Posts: 529



« Reply #2 on: September 12, 2011, 04:20:47 AM »

Hi jmccay,

You should be able to redirect the primary domain to a subfolder similar to what your are asking by following the steps here;

http://support.lunarpages.com/knowledge_bases/article/549
Logged

--

Support and Assistance:
Contacting Us
Hosting Plans
Affiliate Program
Wiki and Tutorials
jmccay
Newbie
*
Offline Offline

Posts: 4


« Reply #3 on: September 12, 2011, 11:45:47 AM »

Thanks for the replies. I had tried the redirects from the cPanel and it worked but the issue is it then displays the subfolder name in the URL in the web browser. I don't wan't that to be the case. I then tried the second option listed here (editing the .htaccess file) and it appears to do the same thing. I'm trying to avoid having the subfolder name show up in the URL.

Any other suggestions?

Thanks in advance.
Logged
MrPhil
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 5220



« Reply #4 on: September 12, 2011, 05:04:39 PM »

In .htaccess:
Code:
RewriteEngine On
RewriteCond  %{REQUEST_URI}  !^/subfolder1
RewriteRule  ^(.*)$  /subfolder1/subfolder2/$1  [L]
I think that will do it. Any URI that doesn't already start with /subfolder1 should get it silently prefixed with /subfolder1/subfolder2/.
Logged

Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-
Pages: [1]   Go Up
  Print  
 
Jump to: