Web Hosting Forum | Lunarpages
News: July 14, 2008 - New Contest! - Submit Your WordPress Theme Designs, Win BIG!
August 5, 2008 - Time to Submit Your Links for the August 08 Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 21, 2008, 09:05:39 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: .htaccess IMPORTANT  (Read 1762 times)
Gamersea
Soon:P
Trekkie
**
Offline Offline

Posts: 15


Hello


« on: January 28, 2007, 08:19:13 AM »

Ok, So normally I always install everything myself, I never use auto-installers.

This time I did for Joomla! and I found out that the .htaccess stays blank.
However if you install Joomla manually you don't get a blank .htaccess

This .htacces file containts some important lines against hacking etc, So I suggest to everybody that installed there Joomla with Fantastico to put this inside your .htaccess of Joomla.

Code:
##
# @version $Id: htaccess.txt 4756 2006-08-25 16:07:11Z stingrey $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


#####################################################
#  READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
#
# Only use one of the two SEF sections that follow.  Lines that can be uncommented
# (and thus used) have only one #.  Lines with two #'s should not be uncommented
# In the section that you don't use, all lines should start with #
#
# For Standard SEF, use the standard SEF section.  You can comment out
# all of the RewriteCond lines and reduce your server's load if you
# don't have directories in your root named 'component' or 'content'
#
# If you are using a 3rd Party SEF or the Core SEF solution
# uncomment all of the lines in the '3rd Party or Core SEF' section
#
#####################################################

#####  SOLVING PROBLEMS WITH COMPONENT URL's that don't work #####
# SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED
# OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING
#
# In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# May need to be uncommented.  If you are running your Joomla/Mambo from
# a subdirectory the name of the subdirectory will need to be inserted into this
# line.  For example, if your Joomla/Mambo is in a subdirectory called '/test/',
# change this:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes##
# to this:
# RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR] ##optional - see notes##
#
#####################################################


##  Can be commented out if causes errors, see notes above.
Options FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On


#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla/MamboDirectory (just / for root)

RewriteBase /


########## Begin Standard SEF Section
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]       ##optional - see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
#RewriteRule ^(content/|component/) index.php
#
########## End Standard SEF Section


########## Begin 3rd Party or Core SEF Section
#
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]   ##optional - #see notes##
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php
#
########## End 3rd Party or Core SEF Section


########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#                             
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a  tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits


Logged

This is my sig.
Lupine1647
Berserker Poster
*****
Offline Offline

Posts: 11086


« Reply #1 on: January 28, 2007, 02:13:14 PM »

While as is, this won't have any affect on your installation (Everything is commented out), it is helpful if you need to turn on items such as 'Pretty URLs' by uncommenting certain lines.
Logged

Grr..!! Grr..!!
TedDeSantaFe
Intergalactic Superstar
*****
Offline Offline

Posts: 179



WWW
« Reply #2 on: January 29, 2007, 03:41:17 PM »

It looks like there are lines at the bottom of Joomla installed .htaccess file which are not commented out. I believe these lines provide defense against hackers. Just be sure the file is named .htaccess and not htaccess.txt.
Logged

Lupine1647
Berserker Poster
*****
Offline Offline

Posts: 11086


« Reply #3 on: January 29, 2007, 03:53:56 PM »

* RyanJ wonders how he missed those lines o_O

But yea, looks like those lines are there to prevent some exploits (which kind of concerns me a little because I think that should be done in the script itself).
Logged

Grr..!! Grr..!!
TedDeSantaFe
Intergalactic Superstar
*****
Offline Offline

Posts: 179



WWW
« Reply #4 on: January 29, 2007, 05:24:18 PM »

I missed those lines myself. But I remember a few months ago, after many Joomla sites were attacked, we were advised on this forum, & on the Joomla forum to add the same lines to our .htaccess file. Also, on our forum, there's information on creating a php.ini file to turn off register globals & url open.

Since then there've been two Joomla updates, & I agree with you the script itself should now be preventing the exploits.

Logged

Gamersea
Soon:P
Trekkie
**
Offline Offline

Posts: 15


Hello


« Reply #5 on: January 30, 2007, 07:27:43 AM »

Well, Normally these lines against those exploits get added to the .htacces file itself, If you install it manually.
Logged

This is my sig.
MagickCrafter
Long live VI
Intergalactic Superstar
*****
Offline Offline

Posts: 156

VI-VI-VI, the Editor of the Beast


WWW
« Reply #6 on: February 15, 2007, 06:05:52 PM »

Yeah but if you install it manually it names it as .htaccess.txt if I am not mistaken.  (I installed it on my localhost server a few weeks ago and I am positive that it had it named .htaccess.txt NOT .htaccess)

Good post btw...  Too bad I don't really like joomla Wink
Logged

http://designandprogram.com/

^^ My programming blog ^^
krick
Spacescooter Operator
*****
Offline Offline

Posts: 42


« Reply #7 on: August 08, 2007, 07:51:34 AM »

Does the absence of this file have anything to do with why my default auto-installed joomla page can only be accessed via "http://www.mydomain.com/index.php" and not by simply using "http://www.mydomain.com/" ?
Logged
Mitch
Lunarpages Traffic Cop
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 7278



WWW
« Reply #8 on: August 08, 2007, 08:36:17 AM »

What do you get when you go to your domain name?
Logged

MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3201



« Reply #9 on: August 08, 2007, 08:40:18 AM »

Does the absence of this file have anything to do with why my default auto-installed joomla page can only be accessed via "http://www.mydomain.com/index.php" and not by simply using "http://www.mydomain.com/" ?

No. More likely you still have a file "index.html" (possibly the default "Welcome" page) in your directory, and that will get picked up before index.php. Just erase or rename "index.html".
Logged

MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3201



« Reply #10 on: August 08, 2007, 08:43:43 AM »

Yeah but if you install it manually it names it as .htaccess.txt if I am not mistaken.  (I installed it on my localhost server a few weeks ago and I am positive that it had it named .htaccess.txt NOT .htaccess)

It shouldn't. More likely someone edited it with a dumb editor like Notepad, which tends to add ".txt" on to files with extensions it doesn't recognize. That, or .htaccess.txt was just intended to be a backup of some sort. If it's supposed to be "active", rename it to .htaccess.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM