LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-01-2012, 06:16 PM   #1
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,542
Blog Entries: 1

Rep: Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001
.htaccess redirection to a specific directory


I created a website for someone. This time I used Joomla. Because I was playing with it at first I had created /joomla directory on the server and installed joomla in that directory. Now the website is almost ready so I'd like to redirect the / to that directory. It's a third-party hosted website. It's a linux server, but I'm not sure if I have any access to apache config files. I've got a cpanel login details at work. The only thing to play with at the moment is .htaccess

I've tried:
Code:
RedirectMatch permanent ^/$ http://www.domain.com/joomla/index.php
It kind of does the job (it redirects www.domain.com to www.domain.com/joomla), but it was hoping I could get rid of the /joomla part in a browser's address bar so that it'd show www.domain.com and not www.domain.com/joomla.

Is it possible with .htaccess only?

Thank you.
 
Old 02-02-2012, 12:32 AM   #2
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Is mod_rewrite on?

If it is, then:

Quote:
RewriteEngine on
RewriteRule ^$ /joomla [L]
 
Old 02-02-2012, 11:47 AM   #3
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,542
Blog Entries: 1

Original Poster
Rep: Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001
Thanks. I don't have login details on me again. I'll check it tomorrow.
 
  


Reply


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache .htaccess redirection '?' (question mark character) using regex angel115 Linux - Software 2 11-05-2009 03:37 AM
LXer: Subdomain Redirection Using htaccess And mod_rewrite On Apache For Linux Or Uni LXer Syndicated Linux News 0 02-27-2009 09:00 AM
htaccess redirection eldojoseph Linux - Server 9 08-02-2008 11:28 AM
.htaccess AuthType Basic - allowing free access to specific file? ivanatora Linux - Software 0 11-21-2007 02:28 AM
Searching a specific directory for a specific extension? RoaCh Of DisCor Linux - Newbie 3 08-13-2005 03:28 PM


All times are GMT -5. The time now is 08:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration