LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   .htaccess redirection to a specific directory (https://www.linuxquestions.org/questions/linux-server-73/htaccess-redirection-to-a-specific-directory-927023/)

sycamorex 02-01-2012 06:16 PM

.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.

klearview 02-02-2012 12:32 AM

Is mod_rewrite on?

If it is, then:

Quote:

RewriteEngine on
RewriteRule ^$ /joomla [L]

sycamorex 02-02-2012 11:47 AM

Thanks. I don't have login details on me again. I'll check it tomorrow.


All times are GMT -5. The time now is 02:38 PM.