Hiding Joomla Subdirectory - GoDaddy PDF Print E-mail

How to move website from domain.com/joomla to http://www.domain.com/

 

After searching numerous blogs and not finding the exact resolution that I was looking for; I finally found some information that was specific for me and am hoping that this will help others in not having to spend hours of searching for an answer.

"I installed Joomla on the Remote Host (Godaddy) only. I created website. Cannot figure out how to make it show up at main site http://www.domain.com instead of http://www.domain.com/joomla. Don't know how to move it to main directory..." (user: MattieSunshine)

..................................................... 

Published by: Joomla Discussion Forum:

 http://forum.joomla.org/viewtopic.php?f=429&t=382334&p=1651704#p1651704

......................................................  

Resolutions

The following is a snippet from the above forum, where if you are using GoDaddy as your service provider, then you will find these two answers just what you may be looking for:

"...
If there is nothing else in the root of your site www.domain.com other than the default Go Daddy files and folders, then in the File Manager of the Hosting Control Center, select the joomla folder in the right pane and click the move button and choose the root of the site from the left pane as the destination. Once that is finished, edit the configuration.php tmp and log paths to reflect this new location (just remove the /joomla)..." (user: 2ninerniner2)"

Response directly from GoDaddy...

 

Note: This redirect option will only work if you are running your website on Linux hosting account:

"These are all great solutions. If you only need to create a redirect you may also find the Sites Redirect Manager helpful. You can redirect your site from http://www.domain.com to http://www.domain.com/joomla. (user: GoDaddy)

Make sure to select the Content Redirect Option of "No Redirect" in order to avoid a circular redirect loop. Detailed instructions can be found in this help article: http://help.godaddy.com/article/5120" (GoDaddy Hosting
http://blog.godaddyhosting.com - Hosting Blog
http://help.godaddy.com- Help Center)"

 

 

.htaccess Option

Reference from: http://www.drichproductions.com/random-knowledge/rewrite-root-directory-subdirectory.php and http://forum.joomla.org/viewtopic.php?f=429&t=382334&p=1651704#p1651704

 

Step #1 -- create an .htaccess file inside the /webroot/ with the contents:

Code:
# Added by Monty - comment made on 2011-11-21 see comments below
Options +FollowSymLinks
RewriteEngine On
# End comment added on 2011-11-21
RewriteBase /

# Add trailing slash if path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://yoursite.com/$1/ [R=301,L]

#Change http://yoursite.com to http://www.yoursite.com (Optional)
#RewriteCond %{HTTP_HOST} ^yoursite.com$
#RewriteRule ^/?(.*)$ http://www.yoursite.com/$1 [R=301,L]
#### Rewrites http://www.yoursite.com/subdir to http://www.yoursite.com/
## Added this to allow existing files and directories to work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
## Now the rewrite of subdir to rootdir
RewriteCond %{REQUEST_URI} !^/joomla
# Added to include comment by Patrick on 2011-10-14 see comment below
RewriteRule ^$ joomla/index.php [L]
# End comment added on 2011-10-14 ... 
RewriteRule ^(.*)$ joomla/$1 [L]
 

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



Step #2 -- rename the standard /webroot/joomla/htaccess.txt file to /webroot/joomla/.htaccess file (no .txt).

 Change "#RewriteBase /" to "RewriteBase /joomla"

Step #3
-- In joomla/configuration.php, set $live_site to var $live_site = 'http://yoursite.com';

 

 

Comments
Add New Search
Tulsisingh  - Not working with windows hosting   |122.178.230.12 |2013-03-14 09:23:43
.htaccess does not works with windows hosting. it will still showing subdirectory under the domain pointed to.
Michael Leavitt  - Success w/Godaddy and Joomla 2.5   |96.25.100.81 |2013-01-24 16:15:43
1/24/2013
Step 1 alone resolved my issue. I did not need to do steps 2 and 3 because these were already done by the GoDaddy 2.5 Joomla installation. My issue is that I was using another code and it worked fine with Firefox but not with Internet Explorer. I also removed the # signs to enable the www rewrite feature. With your code my sites now work flawlessly in Firefox, IE and Chrome. Thanks! Michael Leavitt - Orem, Utah - www.TheHomeInspector.com
Christian  - Existing directories   |212.203.82.134 |2012-12-15 07:01:14
Don't forget to insert the following line in the .htaccess of each existing directories at the root that you want to access:

RewriteEngine Off

Or

RewriteEngine On
...
Rosie  - Thank you!!   |75.136.109.133 |2012-10-24 11:07:12
htaccess option works like magic! Thank you!
michael j  - Admin site not working   |69.165.173.22 |2012-07-28 22:50:20
This solutions seems to have worked well, but then I noticed the admin site is rendering the white screen of death. Any idea how to work around this? I have tried this 3 times with 2 different versions of joomla and it gives the same result...admin site white screen of death. Heartbreak.
admin  - Joomla White Screen of Death   |74.70.153.233 |2012-08-04 17:07:43
There is some information posted on the internet that may be useful to you. Go to http://www.itoctopus.com/blank-page-on-joomla-login; and http://www.phil-taylor.com/2009/01/12/a-blank-white-page-is-still-an-error-page/#.UB1yKKCkOs4

"The error results from a PHP error, but you don’t see what the error is because Joomla, by default, and for security reasons, hides all the PHP errors from the outside world." -- Follow the above links for more information.
Cruxe  - Not work in 2.5   |85.246.72.215 |2012-05-30 10:15:42
I start using this solution since some time ago with Joomla 1.5 websites. Always worked fine.
But now i have a website with 2.5 and only half works.

What I mean is that the redirection is working but Joomla part doesn't.

I have website in /subdir. If I call http://www.domain.com it correctly shows the homepage from /subdir but then all internal links points to http://www.domain.com/subdir. But if I remove /subdir from the generated url it also works.

Example: http://www.domain.com/subdir/page.html or http://www.domain.com/page.html both work, both point to same page.

What could be wrong? First I think $live_site is being ignored in Joomla 2.5 and that generate the wrong internal urls. But don't know why both urls, with or without /subdir, are working.
Francesco  - Subdirectories not working   |188.217.130.79 |2012-05-16 08:14:36
Hello,
i have a hostgator hosting and followed your instructions but now i have a problem.

I have my joomla site working well in my subfolder, what's not working now are subfolders:
i have a subfolder called SITES (at the same level of my joomla folder) with other sites in it (eg. SITES/site1 SITES/site2)
anytime i go at www.site1.com it shows me a 404 page.

I know it's a different hosting but can you please help me or post a solutions for hostgator too?
Miguel Angel  - I cant get it !   |79.109.176.172 |2012-04-03 15:55:54
I have 5 days trying to get the redirrection but I cant do it.

In the root directory I have this htaccess file:

########################################
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,NC,L]

RewriteBase /web

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteRule ^(content/|component/) index.php
RewriteRule (.*) index.php
RewriteRule (.*) - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
########################################

With this code joomla load all the articles but dont load scripts, images, ect.

I have try your code but I can load OK only the home page of joomla and the rest of the links give me a 404 file not found.

Please, I'm five com...
Joomla User  - URL of your website please   |74.70.153.233 |2012-04-03 19:10:39
Sounds like the path to your other files is not being found. If you haven't tried to change the config file as in step 3, please try it. If this fails, can you provide a URL to your website and I may be able to take a quick look.
Miguel   |79.109.176.172 |2012-04-06 14:26:54
Finally I got it. I began from the begining and get it.

Thank you for you web and your help, I would never have succeeded without the information of your website, thank you again.
DB  - one problem   |75.158.1.96 |2012-04-02 04:29:17
Hi,

I have a similar problem to azuser.

The domain does point to the home page now, but all my pages (including home if you click the nav bar link) shows .../joomla/page/...

I narrowed this down to the config file. Once I change the livesite to www.domain.com, the home page now will show just www.domain.com even when using the nav bar,
HOWEVER none of my other pages work. it says there is no target or something. I am guessing the rewrite is trying to access the pages in the main directory when the physical location is still in the subdirectory.

This has been driving me nuts! Please anybody help! I will be forever grateful.

DB
Joomla User  - URL of problem site   |74.70.153.233 |2012-04-03 19:03:40
Can you provide your website address and I'll take a quick look and see if I can help you out.
Ted  - Switching from Test directory to root   |98.102.150.98 |2012-03-02 18:03:44
I just upgraded to joomla 2.5 and I followed the advice about about taking all files out of test directory and putting them in the root directory. I am using Godaddy and if you are going to try this.. Copy the files to the root directory.Then try logging on to www.yourdomain.com I didn't have to change my config file either. Something with Godaddy I guess. If it is successful you can delete the test directory. If not delete then delete just the files that you copied over to your root and you didn't lose anything.
joomlaserviceprovider  - joomla secure   |120.138.102.114 |2012-02-27 08:17:13
jSecure hides your Joomla administrator URL with a special key so that only you can access. The problem with Joomla is that anyone can tell if your site is Joomla by simply typing in the default URL to the administration area (i.e. www.yoursite.com/administrator). jSecure helps you hide the fact that your website is built with Joomla from prying eyes.

Check out jSecure in action here: http://www.joomlaserviceprovider.com/
Yaron  - one more wuestion   |77.127.12.149 |2012-01-21 19:31:25
I had an old joomla intallation in the main folder and after installing the new version in subfolder i followed your directions and managed to switch the domain nice and quick.

BUT, in the administrator panel, every time I save article, the panel "throws" me to the previous joomla installation...!

Any Idea how to fix that?

Thanks ahead!!!
Monty  - Worked with small change   |199.101.129.214 |2011-11-21 18:26:03
I just installed Joomla 1.7.3 on godaddy. This worked for my will a small change to step 1 on the webroot .htacess.

I added the following two lines off of the example he referenced.

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

# Add trailing slash if path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://yoursite.com/$1/ [R=301,L]

#Change http://yoursite.com to http://www.yoursite.com (Optional)
#RewriteCond %{HTTP_HOST} ^yoursite.com$
#RewriteRule ^/?(.*)$ http://www.yoursite.com/$1 [R=301,L]
#### Rewrites http://www.yoursite.com/subdir to http://www.yoursite.com/
## Added this to allow existing files and directories to work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
## Now the rewrite of subdir to rootdir
RewriteCond %{REQUEST_URI} !^/joomla
RewriteRule ^(.*)$ joomla/$1 [L]
Patrick  - Missing One Piece   |74.120.35.3 |2011-10-14 14:10:35
This worked except for one piece, the webroot .htaccess file for me was not getting to the Joomla joomla/index.php file. So here is the change I made in my instance:

## Now the rewrite of subdir to rootdir
RewriteCond %{REQUEST_URI} !^/joomla
RewriteRule ^$ joomla/index.php [L]
RewriteRule ^(.*)$ joomla/$1 [L]
Jan Popovic  - index.php not taken by default   |77.57.191.97 |2011-06-05 15:28:21
Hi All,

Thank you very much for this guideline.

I've followed it to the point but unfortunately when typing http://yoursite.com into the browser address field leads me to the GoDaddy "Coming soon" default page.

When however I include the suffix index.php i.e. http://yoursite.com/index.php my website included within the joomla subdirectory comes up.

Is there anything I could have missed? I would appreciate your ideas.

Thank you!
Jan
Sr  - Redirection   |82.12.10.84 |2011-03-19 22:04:32
I have some issue in website

i kept joomla in one folder called joomla,but I want to see my page in direct domain www.mywebsite.com

but now I can see www.mywebsite.com/Joomla

How can i redirect to my site to main host.

for example

www.mywebsite.com/folder..it works
I want to see www.mywebsite.com



can u please assist how to do it




jijil  - why following code is not working? pls help me   |74.70.157.155 |2011-02-06 19:34:09
RewriteBase /mastersoft/

# Add trailing slash if path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://mastersoftindia.com.com/$1/ [R=301,L]

#Change http://mastersoftindia.com to http://www.mastersoftindia.com (Optional)
RewriteCond %{HTTP_HOST} ^mastersoftindia.com$
RewriteRule ^/?(.*)$ http://www.mastersoftindia.com/$1 [R=301,L]
#### Rewrites http://www.mastersoftindia.com/mastersoft to http://www.mastersoftindia.com/
## Added this to allow existing files and directories to work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
## Now the rewrite of subdir to rootdir
RewriteCond %{REQUEST_URI} !^/mastersoft
RewriteRule ^(.*)$ mastersoft/$1 [L]
NewUsertoJoomla  - Why Code is not working (Maybe?)   |74.70.157.155 |2011-02-06 19:56:18
Change:
RewriteBase /mastersoft/
To:
RewriteBase /
...............
Everything else looks OK to me. Also, see Trent's message below. There are two (2).htaccess files being changed in 2 separate directories. One has RewriteBase / and the other should be RewriteBase /mastersoft
nickg   |72.66.49.118 |2010-11-25 16:28:03
I want to thank you for this simple, smart and perfect resolution for this issue...All the best to you....Nick.
Alek   |216.255.163.131 |2010-10-06 12:39:49
Unfortunately option 2 did not work for me
Trent  - Wow - great!   |74.70.157.155 |2011-02-06 19:59:54
Success! THANK YOU! The directions are great and easy to follow. One small thing to consider is that in step 2 of the .htaccess option you must change "#RewriteBase /" to "RewriteBase /joomla" (text inside this file) BEFORE renaming the file (removing the .txt). Otherwise you may not be able to open it. Also remember to name BOTH .htaccess files with no .txt extension. That's my small comment. Thank you again! Life saver!
azruser   |72.84.251.183 |2010-04-04 11:14:37
This is almost perfect. It is by far the simplest format to follow. I just have one issue. I did a test by copying the folder and it worked except after the home page all other pages still had .../joomla/new... I thought it was because I didn't move the folder. So I tried by moving the folder and I just got 404 errors.

JoomlaNewUser   |72.224.95.11 |2009-05-05 15:16:40
:) This answered my question right away!
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
  

 nbsp;"

 

Your Breadcrumbs:

Home Website Accessibility - Structural Sufficiency

Visitors

mod_vvisit_counterTotal Visitors868481

Your IP: 54.234.42.16
,
Today: May 23, 2013