I have Joomla site which was upgraded to newest version. New version is in /new/ folder. How can I instruct apache through the .htaccess file to redirect all requests to /new/ folder instead to public_html?
A:
The best way would be to change the virtual host file and point to the new path.
But if you dont want to change the root path, you can use mod_rewrite to achieve this, using something similar to this in your .htaccess file:
RewriteEngine on
RewriteRule ^(.*)$ new/$1 [L]
It would grab everything after the domain name, and append it after 'new/' Make sure you have the mod_rewrite module enabled.
You can find more information on how to set rules in mod_rewrite here
Benjamin Ortuzar
2009-12-14 14:06:58
I already tried this, that is why I am posting here. There is still no domain for this new site so there is /~username/ appended to the server ip adress could this be a problem?
Aleksandar
2009-12-14 14:23:18
A:
This is usefull when yuo have more redirects in your .htaccess
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ new/$1 [L,R=301]
</IfModule>
Chris
2009-12-17 09:14:07