htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: htaccess Hell
PostPosted: 06 Sep 2008 18:17 
Offline

Joined: 06 Sep 2008 17:32
Posts: 3
Firstly hi all, im new here :)

I have a big problem because i have 2 htaccess files i need im my doc root and have tried to combine them but one confilcts with the other and visa versa...

Let me explain what i have. I have joomla 1.5 and my reseller files from my reseller provider. This is my htaccess from my reseller
Code:
<IfModule mod_ssl.c>
   RewriteBase /myreseller.co.uk
</IfModule>
<IfModule !mod_ssl.c>
   RewriteBase /
</IfModule>
   RewriteEngine On
        RewriteRule ^([^.]*)$ index.cgi/$1 [L,NE]
RewriteEngine On
RewriteRule ^([^.]*)$ index.cgi/$1 [L]


This is my Joomla htaccess
Code:
##
# @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 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.
#
#####################################################

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

#
#  mod_rewrite in use

RewriteEngine On

########## 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 <script> 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

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

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section


I would like Joomla to be the default, so when people visit my site the Joomla home page is present first. I will call the index.cgi from my reseller package in a wrapper.

I need the reseller htaccess details for my reseller account to work and display correctly.

I noticed alot of posts here with zero replies and hope not be one of them.

Any help apreciated..


Top
 Profile  
 
 Post subject: Re: htaccess Hell
PostPosted: 12 Sep 2008 02:12 
Offline

Joined: 30 Oct 2006 19:55
Posts: 99
Pixelated wrote:
....I would like Joomla to be the default, so when people visit my site the Joomla home page is present first. I will call the index.cgi from my reseller package in a wrapper.

I need the reseller htaccess details for my reseller account to work and display correctly.




Code:
## Allow symlinks to be followed
Options +FollowSymLinks

## Turn on Rewrite Module Engine
RewriteEngine On

## Set the Rewriting Base at /
RewriteBase /

## Pass the basic/digest authentication HTTP header to environment variable
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]


########## Begin - Rewrite rules to block out some common exploits
## Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [NC,OR]
## Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
## Block out any script that includes a <script> 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}) [NC,OR]
## Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [NC]
## Send all blocked request to homepage with 403 Forbidden error!
RewriteRule . /index.php [F,L]
########## End - Rewrite rules to block out some common exploits



########## Begin - Joomla! core SEF Section
## If requested file does not exist
RewriteCond %{REQUEST_FILENAME} !-f
## If requested file is not a directory
RewriteCond %{REQUEST_FILENAME} !-d
## If requested uri is not index.php OR index.cgi
RewriteCond %{REQUEST_URI} !^/index\.(php|cgi) [NC]
## If requested uri is / OR /anything-but-a-dot OR /anything.php|htm|html|feed|pdf|raw
RewriteCond %{REQUEST_URI} ^(/|/[^.]*|/*\.(php|html?|feed|pdf|raw))$  [NC]
## Handle request using the /index.php file
RewriteRule . /index.php [L]
########## End - Joomla! core SEF Section



Ok so that will make joomla work... tell me more about this index.cgi and reseller stuff..



Code:
########## Begin - Reseller Section
<IfModule mod_ssl.c>
## If the module mod_ssl.c is found then change the RewriteBase to /myreseller.co.uk/
RewriteBase /myreseller.co.uk/
</IfModule>

RewriteCond %{ENV:REDIRECT_STATUS} !=200
## If requested uri is not index.php OR index.cgi
RewriteCond %{REQUEST_URI} !^/index\.cgi [NC]
RewriteRule ^([^.]*)$ /index.cgi/$1 [L,NE]
########## End - Reseller Section


Top
 Profile  
 
 Post subject: Re: htaccess Hell
PostPosted: 12 Sep 2008 10:10 
Offline

Joined: 06 Sep 2008 17:32
Posts: 3
Thanks for your reply... The reseller htaccess need everything that's coded. I have tried to remove pieces of the code but then it stops my reseller gui from showing and working correctly. When i say working correctly i mean i cannot login or it's displayed correctly.

Thanks

Oh also i think in collect certain pages and rewrites as one?


Top
 Profile  
 
 Post subject: Re: htaccess Hell
PostPosted: 12 Sep 2008 13:56 
Offline

Joined: 30 Oct 2006 19:55
Posts: 99
I need more info about your reseller account and how your website is organized...

Basically, what has to happen for a user to see the reseller account? Do they just goto /reseller/ or does it automatically display for https? Obviously joomla is not your reseller account right?


Top
 Profile  
 
 Post subject: Re: htaccess Hell
PostPosted: 12 Sep 2008 16:28 
Offline

Joined: 06 Sep 2008 17:32
Posts: 3
Its hard to explain. I had Joomla set-up in my site root dir. I usually have my reseller in /hosting/. If i delete my htaccess for the reseller all i get is a redirect loop. I may be doing this the hard way wanting both in the root.

Also to have Joomla show sef urls i have to enable the htaccess for that and i think that's where the conflict happens.

I'll "PM" my url to you but at the minute my root only has a index.html while i get this configured and /hosting/ is set to the default template i get from my hosting/reseller provider. Im trying to combine my new joomla template to wrap what you see when you view the hosting home page. They don't make it easy to customise the default template but i can just wrap the hosting inside Joomla or preferably create the a template for the hosting side to mirror the joomla template. Hope you understand how Joomla works with the wrapper. If you wrap a page and it's bigger than the template it adds scroll bars and that's what im trying to avoid.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB