4646 Posts in 1402 Topics by 1394 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2034 Views |
-
Hide the subdirectory silverstripe is in

14 November 2009 at 9:08am
What's up?
I have installed SilverStripe into a subdirectory on my web server, and I want my domain name to go straight to SilverStripe so I can use other subdirectories for other domain names I am going to get in the future. I have successfully been able to point my main domain to the /silverstripe subdirectory, but the problem I have now is when I am browsing through my SilverStripe site it still has /silverstripe in the URL. I want to get rid of this.
e.g.
www.mydomain.com
actually points to
www.mydomain.com/silverstripe
but appears in the browser URL bar as
www.mydomain.comWhen I click to say, the About Us page, the URL becomes
www.mydomain.com/silverstripe/about-us/Is there a way to modify the .htaccess file to simply hide "/silverstripe" from the browser's URL bar?
Another approach might be to somehow modify SilverStripe's base URL, although I've read around the forums that people have run into problems with this approach.This seems like it should be a very simple thing to do, but I spent hours yesterday Googling this to no avail. Any help would be appreciated. Thanks!
-
Re: Hide the subdirectory silverstripe is in

14 November 2009 at 10:07pm
Isn't this something you should discuss with your provider?
And on another note, I do think you can just use your subdirs for other domains even if silverstripe resides in the top domain. The htacccess file in yor public_html folder (or whatever it is called) is ignored for subdomains and addon domains. I have my addon/sub domains in a folder starting with a an underscore so I am sure that no names I can come up with will intervene with those folders (in my case I am using _domains for all my domains).
And since I also sometimes have to give people direct access to some files - and not all of them are comfortable with ftp - I also have the rule RewriteCond %{REQUEST_URI} !^/_.*/.* added to my htaccess
-
Re: Hide the subdirectory silverstripe is in

15 November 2009 at 11:49pm
I am having the same problem and can't find an answer anywhere! Any pointers anyone??
-
Re: Hide the subdirectory silverstripe is in

16 November 2009 at 3:31am
Right, I'm no .htaccess expert, but this is my take on it.
If you were able to get the htaccess folder in the root of your public_html to check the http_host and then determine if it is the SS domain, it would apply slightly modified SS htaccess rules.
This isn't working code, but shows my idea:
### SILVERSTRIPE START ###
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files><IfModule mod_rewrite.c>
RewriteEngine OnRewriteCond %{HTTP_HOST} !^exampledomain.com$
RewriteCond %{REQUEST_URI} !(\.gif$)|(\.jpg$)|(\.png$)|(\.css$)|(\.js$)RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* subdir/sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
### SILVERSTRIPE END ###So the idea is check the domain and then re-write to subdir/sapphire... Hopefully someone with some proper htaccess knowledge will correct this so it's working
-
Re: Hide the subdirectory silverstripe is in

23 December 2009 at 10:03am
I was never able to figure this out.
I gave up and finally moved all the code to my base directory. Doing that was really easy and didn't cause anything to break. Just be sure you move the .htaccess file with it.
This was never a critical issue, I just wanted to do this for cleanliness and ease of backups down the road. Now all my SilverStripe files and folders are alongside my other unrelated files. It's a little messy but it works.
| 2034 Views | ||
|
Page:
1
|
Go to Top |



