I've asked question before but haven't found solution. So I'm posting again with some additional infos. I've tried to move all file to root from sub-directory called (Silverstripe), but then blank page showed up. even i delete default.aspx and web.config file too. and also played with .htaccess file. and I'm not much awar of these stuff, so this is why i posted my issue here.
The Problem is I want to remove sub-directory from url & permalinks as well. e.g.
http://www.jtrainingsolutions.com/Silverstripe/ => http://www.jtrainingsolutions.com/
Root Map:
- /Silverstripe - (Subdirectory)
- root/Silverstripe/.htaccess
- root/Silverstripe/web.config
- root/and other Silverstripe CMS files
- /default.aspx
default.aspx:
<%
If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("www.jtrainingsolutions.com") ) > 0 Then
Response.Redirect("/Silverstripe")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("jtrainingsolutions.com") ) > 0 Then
Response.Redirect("/Silverstripe")
End If
%>
.htaccess file:
### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>
<Files web.config>
Order deny,allow
Deny from all
</Files>
ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html
<IfModule mod_alias.c>
RedirectMatch 403 /silverstripe-cache(/|$)
</IfModule>
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)|(\.php$)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ Silverstripe/$1 [L]
RewriteBase /Silverstripe
</IfModule>
### SILVERSTRIPE END ###
and web.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<hiddenSegments applyToWebDAV="false">
<add segment="silverstripe-cache" />
</hiddenSegments>
</requestFiltering>
</security>
<rewrite>
<rules>
<rule name="SilverStripe Clean URLs" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="sapphire/main.php?url={R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Please advise me how to fix this issue. thanks in advance.