Under certain condition I have no choice to do so (Having a subfolder)
I already have good, clean Url, without the subfolder name
My root htacces is:
# Use PHP5CGI as default
AddHandler fcgid-script .php
# AddHandler application/x-httpd-php5s .php
# Bluehost.com
# .htaccess main domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line.
RewriteEngine on
# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?YOURSITENAME.com$ [NC]
# Change 'subfolder' to be the folder you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/YOURSUBFOLDERNAME/
# Don't change these lines.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subfolder' to be the folder you will use for your main domain.
RewriteRule ^(.*)$ /YOURSUBFOLDERNAME/$1 [L]
# Change yourdomain.com to be your main domain again.
# Change 'subfolder' to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?YOURSITENAME.com$ [NC]
RewriteRule ^(/)?$ YOURSUBFOLDERNAME/index.php [L]
<Files 403.shtml>
order allow,deny
allow from all
</Files>
Note: I use the mod rewrite to erase the subfolder from the url
The joomla htaccess (inside subfolder) stay like the original (only little addition for security and performance. (no
# RewriteBase /
)
My configuration.php have
var $live_site = 'http://www.YOURSITENAME.com';
Everything is rosy with SEF and google verification and all. But, I think this give me 302 redirect, I’m not sure.
I really want to have 301