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: 34065 Views
  • mickymacmi
    Avatar
    12 Posts

    .htaccess problem Link to this post

    Hi,

    I'm currently using my SilverStripe website on a shared cPanel hosting account, however when I install my SilverStripe website to the public_html directory any subdomains/add-on domains (in a separate folder off the public_html folder) comes up with an error message relating to the SilverStripe website.

    Removing the .htaccess file enables all the subdomains to work correctly but the SilverStripe website won't function.

    If anyone has any simple hack or something I can put in the .htaccess file to work around this it'd be great.

  • Andy
    Avatar
    230 Posts

    Re: .htaccess problem Link to this post

    This is really weird, the .htaccess in one domain shouldn't affect another. What is the error message you are getting?

  • mickymacmi
    Avatar
    12 Posts

    Re: .htaccess problem Link to this post

    Hi Andy, thanks for your response.

    When I try access a subdomain/parked domain that is hosted in a folder (lets say site1) off the root side where SilverStripe is located I get the following:

    ----
    Not Found
    The requested URL /home/username/public_html/sapphire/main.php was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    --------

    If I was to go and type in mydomain/foldername I get the CMS show up with a 'Page not Found' message, however if I remove the .htaccess file everything except the CMS works perfectly. This could probably be resolved with a couple of lines of code in the .htaccess file but I'm already way out of my depth.

  • mickymacmi
    Avatar
    12 Posts

    Re: .htaccess problem Link to this post

    Does anyone have any ideas for this?

  • Matt
    Avatar
    Core Development Team
    84 Posts

    Re: .htaccess problem Link to this post

    While .htaccess files won't affect the domain, that's only because normally sub-domains are kept in separate folders.

    With cPanel and some other hosting packages, the root of the site is public_html, with subdomains being created as directories under public_html.

    .htaccess inherits in a similar manner to classes - if it can't find a .htaccess in the current directory (say public_html/site1), it'll look in the parent directory (public_html), all the way back up until it either finds a file, or reaches the web root.

    In your case, it might be as simple as dropping a blank .htaccess file into your other sub-domains? If I recall correctly, Apache will stop looking for .htaccess files once it's found one.

    Hope that helps

  • mickymacmi
    Avatar
    12 Posts

    Re: .htaccess problem Link to this post

    Thanks for the suggestions Matt,

    I'll try that and see how I get on.

  • mickymacmi
    Avatar
    12 Posts

    Re: .htaccess problem Link to this post

    Well that unfortunately didn't seem to work... Looks like it's back to Joomla! for me

  • trevor
    Avatar
    53 Posts

    Re: .htaccess problem Link to this post

    I had a similar problem until I realised that I had created the other accounts not necessarily incorrectly but there was a better way. I have cpanel but also the option for WHM management and this has a create account option. from here if you have multiple domain names you create a whole new account which sits underneath your main account but has its own folder and access. this worked for me don't know if you have the same but just thought it might help.

    I'm Learning all the time.

    Trevor

    34065 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.