问题描述:

I have a Joomla site with a blog attached to it.

I created a new homepage for it, though, that uses just plain html and have uploaded it to the /new/ directory. I'm trying to write an htaccess redirect that will allow me to use the /new/ directory just for the homepage, but still use the Joomla part for the blog.

Here's what I have tried so far, but it doesn't work.

RewriteCond %{REQUEST_URI} !^/new/

RewriteRule ^ /new/ [L]

This actually redirects it in the browser to /new/ instead of doing it underneath the hood, invisibly. Also when I go to the /blog/ page, it is very messed up. In sum:

domain.com --> domain.com/new/ (but don't show the redirect)

domain.com/* --> allow joomla to do its thing

网友答案:

If you're just trying to do: turbobuilt.com -> turbobuilt.com/new/ then use:

RewriteRule ^$ /new/ [L]

rule as very first rule in your root .htaccess.

网友答案:

I couldn't get @anubhava solution to work, so I just moved my whole joomla installation into the /blog/ folder. There are just a couple of changes that you have to make in the configuration.php file. After that I put my new site in the root folder.

相关阅读:
Top