Results 1 to 13 of 13
Thread: .htaccess guru needed :)
-
10-07-2008, 12:59 PM #1Disabled
- Join Date
- Aug 2006
- Location
- London
- Posts
- 651
.htaccess guru needed :)
Hi!,
I've installed silverstripe CMS on my main domain. It comes with a .htaccess file with the following in it:
### SILVERSTRIPE START ###
<IfModule mod_dir.c>
DirectorySlash Off
</IfModule>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
### SILVERSTRIPE END ###
This configuration stops access to other folders on the domain such as my support system.
www.mydomain.com/support, currently forwards to silverstripes 404 error page.
Does anyone know how to modify the .htacces to allow me to access my support directory? I got close to it, but got a 500 error...
-
10-07-2008, 01:32 PM #2Web Hosting Master
- Join Date
- Oct 2004
- Location
- Kerala, India
- Posts
- 4,771
If you put the trailing slash is it working?
http://domain.com/support/David | www.cliffsupport.com
Affordable Server Management Solutions sales AT cliffsupport DOT com
CliffWebManager | Access WHM from iPhone and Android
-
10-07-2008, 01:49 PM #3Disabled
- Join Date
- Aug 2006
- Location
- London
- Posts
- 651
-
10-07-2008, 01:55 PM #4Newbie
- Join Date
- Sep 2008
- Posts
- 13
The quickest way to fix this is create a new blank .htaccess file, and put
RewriteEngine Off
Then place this file in each directory you want not to forward to your CMS 404.
-
10-07-2008, 02:53 PM #5Aspiring Evangelist
- Join Date
- Jun 2003
- Posts
- 367
Try this:
Code:### SILVERSTRIPE START ### <IfModule mod_dir.c> DirectorySlash Off </IfModule> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ RewriteCond %{REQUEST_URI} !^/support RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L] ### SILVERSTRIPE END ###
Common sense is not so common.
-
10-07-2008, 05:20 PM #6Disabled
- Join Date
- Aug 2006
- Location
- London
- Posts
- 651
YES!!!!
Next problem! The subdomain for the support system doesn't work...
http://support.dediserversdirect.com
-
10-07-2008, 05:59 PM #7Disabled
- Join Date
- Aug 2006
- Location
- London
- Posts
- 651
Hi,
I'm now using
Code:### SILVERSTRIPE START ### <IfModule mod_dir.c> DirectorySlash Off </IfModule> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ RewriteCond %{HTTP_HOST} ^support.dediserversdirect.com$ RewriteCond %{REQUEST_URI} !^/support RewriteRule ^(.*)$ support/$1 [L] RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L] ### SILVERSTRIPE END ###
-
10-07-2008, 06:19 PM #8WHT Addict
- Join Date
- Dec 2007
- Location
- IN
- Posts
- 146
Have you tried placing a blank .htaccess on the folder?
█ Inway - India's Most Trusted Web Host
█ SSD Web Hosting + CMS + Email Solutions Simplified
█ Visit us at Web Hosting India
-
10-07-2008, 07:07 PM #9Junior Guru Wannabe
- Join Date
- Oct 2008
- Location
- Ohio
- Posts
- 41
Have you tried escaping the dots in this line:
RewriteCond %{HTTP_HOST} ^support.dediserversdirect.com$
change to:
RewriteCond %{HTTP_HOST} ^support\.dediserversdirect\.com$
-
10-07-2008, 07:15 PM #10Disabled
- Join Date
- Aug 2006
- Location
- London
- Posts
- 651
-
10-07-2008, 07:24 PM #11Junior Guru Wannabe
- Join Date
- Oct 2008
- Location
- Ohio
- Posts
- 41
Do you have access to your server's apache error log; it will tell you exactly which part of the .htaccess file that is erroring. For instance, on my system, where mod_dir is not installed, the error log says this:
[Tue Oct 7 19:21:58 2008] [alert] [client 71.61.41.75] /home/jemjem/jem-www/.htaccess: Invalid command 'DirectorySlash', perhaps mis-spelled or defined by a module not included in the server configuration
-
10-07-2008, 08:28 PM #12Junior Guru Wannabe
- Join Date
- Oct 2008
- Location
- Ohio
- Posts
- 41
Once you get your particular internal server error worked out, the following will redirect your subdomain to the support directory; if the index page is not where you have them starting, then just substitute index.html for your start page within the support directory.
RewriteCond %{HTTP_HOST} ^support\.dediserversdirect\.com
RewriteRule .* support/index.html [L]
-
10-08-2008, 08:25 PM #13Aspiring Evangelist
- Join Date
- Jun 2003
- Posts
- 367
Hi,
Shouldn't you have the sub-domain condition negated? i.e. you don't want the rewrite to happen on the sub-domain.
Code:### SILVERSTRIPE START ### <IfModule mod_dir.c> DirectorySlash Off </IfModule> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ RewriteCond %{HTTP_HOST} !^support\.dediserversdirect\.com$ RewriteCond %{REQUEST_URI} !^/support RewriteRule ^(.*)$ support/$1 [L] RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L] ### SILVERSTRIPE END ###
A bad .htaccess file can cause a 500 error.Common sense is not so common.