Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » .htaccess problem

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2
Go to End
Author Topic: 34166 Views
  • mickymacmi
    Avatar
    12 Posts

    Re: .htaccess problem Link to this post

    Hi Trevor,

    I do have WHM with my package, but it seems such a shame to have an entire cPanel account just for a 2mb website that uses a subdomain off the main one

  • trevor
    Avatar
    53 Posts

    Re: .htaccess problem Link to this post

    I think that the cpanel is generic across all accounts unless you have to pay extra for each one in which case I agree with you.

    The cpanel account for each one does at least enable you to keep things seperate, as if you end up maintaining lots more sites (as hopefully you will) by just having the seperate directories there is a risk that you may transfer something in to the wrong one by mistake, if you have seperate cpanel and ftp etc then you are able to keep things apart.

    By the way where are you based I'm in the UK.

    Trevor

  • mickymacmi
    Avatar
    12 Posts

    Re: .htaccess problem Link to this post

    I unfortunately have an account limit, and whilist I haven't reached that as of yet, I'd hate to waste them unnecessarily.

    I'm in Australia.

  • SLJ
    Avatar
    Community Member
    23 Posts

    Re: .htaccess problem Link to this post

    I know that this is an old thread. I was having the same problem today. What has worked for me is putting 'RewriteEngine off' in the .htaccess file in the directory for my subdomain. My configuration uses a subdirectory under the public_html directory in a cpanel environment.

    This only works if what you want to put in the subdomain does not need to interact with your SilverStripe site at all beyond linking to it, which in my case it doesn't. Hope this helps some one.

  • mickymacmi
    Avatar
    12 Posts

    Re: .htaccess problem Link to this post

    Thanks for those suggestions. I totally forgot about this thread until I recieved an email this morning.

    I might give silverstripe another look then (currently still using my old Joomla! site).

  • McSwain
    Avatar
    Community Member
    4 Posts

    Re: .htaccess problem Link to this post

    I just came upon the same problem. I had two Joomla! installations, one on the main site and one on a sub domain that is linked to a directory on the /public_html/ of the main site. As soon and I installed SliverStripe on the main site, my subdomain Joomla install stopped working. I tried turning the RewriteEngine off, which made the sub directory work fine but stopped SilverStripe from working. Then I made a copy of the SilverStripe .htaccess and made the following changes:

    RewriteEngine On

    RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$

    RewriteCond %{REQUEST_URI} ^(.*)$

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteRule .* /index.php?url=%1&%{QUERY_STRING} [L]

    RewriteBase /

    basically just changing /sapphire/main.php from SilverStripe to the index.php of Joomla and uploaded this to the sub domain. Now everything works fine. Hope it helps.

  • Frank Juval
    Avatar
    Community Member
    3 Posts

    Re: .htaccess problem Link to this post

    I had the same problem and I think I found the solution.

    I emailed Silverstripe instead of coming here. I got help but was reminded that the forum was the place to be.

    Anyway, tech support at my host site said it was an .htaccess problem so he commented out the line:

    RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]

    I was back to a static page for my site.

    Then I read this post. So I added an .htaccess file to all my subdomains. Nothing worked. Although, this whole time one subdomain wasn't affected. So I opened that .htaccess file and it read:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /monkeychow/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /monkeychow/index.php [L]
    </IfModule>

    # END WordPress

    One of my blogs is on http://frankjuval.com/monkeychow/ (just to give a little history to help this make sense).

    So I copied and pasted the above code into each .htaccess file for each directory, but just changed "monkeychow" to the name of the specific directory each .htaccess file was in. It worked!

    You'll also want to make sure that there's an "index.php" file in the directory you're pointing it to. If there's an "index.html" file instead, just change that last line to read:

    RewriteRule . /directory_name/index.html [L]

    Do you understand? Or does this confuse you more?

    I'm sure the "Begin WordPress...End WordPress" has to be changed accordingly as well. It just so happens that my blogs are with WordPress so I kept that in.

  • truevision
    Avatar
    Community Member
    5 Posts

    Re: .htaccess problem Link to this post

    THANK YOU! lol

    you made me a verry happy man lol

    34166 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.