Support

Admin Tools

#14716 Personalized .htaccess

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Tuesday, 22 January 2013 01:13 CST

user71930

Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? Yes, .htaccess
Have I searched the tickets before posting? yes
Have I read the documentation before posting (which pages?)? yes
Joomla! version: 2.5.8
PHP version: (unknown)
MySQL version: (unknown)
Host: (optional, but it helps us help you)
Admin Tools version: (unknown)

Description of my issue:  I wanted to request personalized assisstance for my .htaccess. This is my first post here, btw.

nicholas
Akeeba Staff
Manager

Hello Harvey,

Do you have a specific request? If you describe your issue I can help you.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user71930

Hi Nicholas,

                I'm a novice when it comes to .htaccess files. I'm currently using basic .htaccess file that comes with the Joomla package, so anything/everything to make the site more Seo friendly would be appreciated.

However, One specific thing I do want is the 301 direct to my www subdomain instead of the root domain.

nicholas
Akeeba Staff
Manager

Ah, OK, that's simple. You need the basic non-www to www redirection. Luckily, I have the solution in my Master .htaccess file. You need to add the following lines right below your .htaccess file's RewriteBase line:

########## Begin - Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
## If the above throws an HTTP 500 error, swap [R=301,L] with [R,L]
########## End - Redirect non-www to www

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user71930

So, should i copy the whole Master .htaccess file and apply it to my site with the rewritebase line? I'm sorry, I'm a little confused. Could you possible elaborate on that, I'm really new to this .htaccess business.

nicholas
Akeeba Staff
Manager

No. If the ONLY thing you want is the non-www to www redirection only copy these lines:

########## Begin - Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
## If the above throws an HTTP 500 error, swap [R=301,L] with [R,L]
########## End - Redirect non-www to www

into your existing .htaccess file, after your RewriteBase line.

If you want to include all the security features of the Master .htaccess you can use Admin Tools Porfessional's .htaccess Maker. That's what it does. BUT! Before trying to use .htaccess Maker you need to do some reading. Make sure you have read the documentation and understand that some things may break and you'll have to do some very easy debugging to fix them, exactly as mentioned in the documentation. The .htaccess Maker (and the Master .htaccess upon which it is based) are very potent.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!