Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 01 Aug 2016, 22:43
Mondi Mondi is offline
 
Join Date: Sep 2006
Cool Installation under SilverStripe | incorrect .htaccess redirect?

Hi all -

We installed vB5.2.2. under a Silverstripe installation in a '/community' folder, which should give members access to our forum following http://e-lumini.com/community

However, Silverstripe's .httaccess presumably appends this url incorrectly to http://e-lumini.com/community/?url=/community which, of course, makes the forum inaccessible. Although this question should perhaps better be asked at Silverstripe communities I am just wondering whether one of you are much cleverer than I am with .htaccess structures and contents and could possibly help me pull this redirect issue back on track..?

**** SS .htaccess contents *****

### SILVERSTRIPE START ###
# Deny access to templates (but allow from localhost)
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>

# Deny access to IIS configuration
<Files web.config>
Order deny,allow
Deny from all
</Files>

# Deny access to YAML configuration files which might include sensitive information
<Files *.yml>
Order allow,deny
Deny from all
</Files>

# Route errors to static pages automatically generated by SilverStripe
ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_rewrite.c>

# Turn off index.php handling requests to the homepage fixes issue in apache >=2.4
<IfModule mod_dir.c>
DirectoryIndex disabled
</IfModule>

SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteBase '/'



# Deny access to potentially sensitive files and folders
RewriteRule ^vendor(/|$) - [F,L,NC]
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
RewriteRule composer\.(json|lock) - [F,L,NC]

# Process through SilverStripe if no file with the requested name exists.
# Pass through the original path as a query parameter, and retain the existing parameters.
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* framework/main.php?url=%1 [QSA]
</IfModule>
### SILVERSTRIPE END ###


***** end SS .htaccess contents *******

Many thanks in advance for your assistance!

Mondi
Reply With Quote
  #2  
Old 01 Aug 2016, 23:59
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Add the code below at the top of your forums .htaccess file.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.








.
Attached Images
File Type: png 001159.png (14.2 KB, 14 views)
Reply With Quote
  #3  
Old 02 Aug 2016, 00:13
Mondi Mondi is offline
 
Join Date: Sep 2006
Hey Seven Skins - cheers for responding to my post.

I am actually thinking the 'blockage' sits within the SS .htaccess file above; not in that of the forum's './community' installation. There are a few 'denies' in there which may need to be appended to include that community's folder name.

A little reluctant to 'off' the community's htaccess file for now.

Looking for alternatives now....

Cheers mate!
Reply With Quote
  #4  
Old 02 Aug 2016, 00:21
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
You can put this near the top of your SS .htaccess file and this should ignore the community folder.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #5  
Old 02 Aug 2016, 01:27
Mondi Mondi is offline
 
Join Date: Sep 2006
Nope - ain't happy. Now running into a 403. Wrecking my brains now Seven Skins.

.htaccess now looks:

### SILVERSTRIPE START ###
# Deny access to templates (but allow from localhost)
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>

# Deny access to IIS configuration
<Files web.config>
Order deny,allow
Deny from all
</Files>

# Deny access to YAML configuration files which might include sensitive information
<Files *.yml>
Order allow,deny
Deny from all
</Files>

# Route errors to static pages automatically generated by SilverStripe
ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_rewrite.c>

# Turn off index.php handling requests to the homepage fixes issue in apache >=2.4
<IfModule mod_dir.c>
DirectoryIndex disabled
</IfModule>

SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteBase '/'

RewriteRule ^community - [L,NC]

# Deny access to potentially sensitive files and folders
RewriteRule ^vendor(/|$) - [F,L,NC]
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
RewriteRule composer\.(json|lock) - [F,L,NC]

# Process through SilverStripe if no file with the requested name exists.
# Pass through the original path as a query parameter, and retain the existing parameters.


RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* framework/main.php?url=%1 [QSA]
</IfModule>
### SILVERSTRIPE END ###
Reply With Quote
Reply


Tags
.htaccess, redirect, silverstripe


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 17:48.

Layout Options | Width: Wide Color: