ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Problem with removing index.php and htaccess on Fasthosts Server

March 23, 2012 4:56pm

Subscribe [3]
  • #1 / Mar 23, 2012 4:56pm

    DigitalSpirit

    11 posts

    Hi

    I’m having problems trying to remove index.php and the .htaccess file with a website hosted on a Fasthosts server.

    We’ve been trying over the last few days all the possible options that are listed on the wiki and the EE guide.

    We now have the following that is nearly working:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    # Removes index.php
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /beta/index.php?/$1 [L]
    # If 404s, “No Input File” or every URL returns the same thing
    # make it /index.php?/$1 above (add the question mark)
    </IfModule>


    We are linking the stylesheets in an includes file using the following:

    <link href=”?css=style/layout” rel=“stylesheet” type=“text/css” media=“screen” />


    Under General Configuration the field for the name of site index page is left blank.

    The images are referenced into the images folder: images/logo.png


    As you can see from the following pages the home and pages in some of the template groups are fine but if you go to a dynamic news item then the images do not appear.

    http://www.swisher.co.uk/beta/

    http://www.swisher.co.uk/beta/company

    http://www.swisher.co.uk/beta/news but if you go a third level deep like in the news article

    http://swisher.co.uk/beta/news/article/swisher-uk-acquired-by-environmental-biotech then the images are lost.


    Many thanks

    James

  • #2 / Mar 25, 2012 1:24pm

    Dan Decker

    7338 posts

    Hi Twist-id,

    I’m sorry you are having trouble getting the CSS to behave properly!

    There are a couple of things to try with this.

    The most simple would be to place your CSS in a static file and test the results with that. The other would be to make sure your url(); values in your CSS use absolute paths to the image folder.

    Let me know the results of those tests.

    I look forward to your reply!

    Cheers,

  • #3 / Mar 26, 2012 5:03am

    DigitalSpirit

    11 posts

    Hi Dan

    The css is fine it’s the images and Javascript for the nav that are not showing.

    For example the logo is not showing on this page - http://swisher.co.uk/beta/news/article/swisher-uk-acquired-by-environmental-biotech.

    This is referenced in a document includes file with the following.

    <a href="http://index.php" title="Go back to the homepage">images/logo.png</a>

    Thanks

    James

     

  • #4 / Mar 27, 2012 6:41pm

    Sean C. Smith

    3818 posts

    Twist-id,

    In your code above if you put a slash in front of the path to the image does it work?

    <a href="http://index.php" title="Go back to the homepage">/images/logo.png</a>
  • #5 / Mar 28, 2012 7:43am

    DigitalSpirit

    11 posts

    HI Sean

    That’s how we usually code the site up, but it wouldn’t work for some reason.

    We think we have now found a work around by referencing the images with with an absolute path including the beta folder and will then remove them all on publishing the site live.

    Thanks

  • #6 / Mar 30, 2012 5:37am

    Mobster

    64 posts

    Not to dredge up an old topic but I’ve been pulling my hair out with a similar issue.

    I’ve never been a fan of using absolute paths in css any any cms.  The problem is, in development its fine but say you want to push the site to a live environment, you then need to go back and change all absolute paths. 

    I have tried:

    {site_url}

    Assigning a global variable for the image folder.

    {preload_replace:image_path="http://foo/~foobar/assetes/images/"}


    then:

    {image_path}/foo.png

    All of which break when in different situations like. 

    A link with {homepage} url is http://foo/~foobar/index.php/ with a trailing slash breaks the image paths. 

    But if you remove the trailing slash.  The image paths work.

    Quite frankly, I never experienced these sort of issues with older versions of EE and this has cost me almost a days work trying to figure and and I’m stumped. 

    Can someone please point out the dynamic absolute path tag in EE2? Or perhaps a work around? 

    Thanks!

  • #7 / Apr 02, 2012 3:50pm

    Shane Eckert

    7174 posts

    Hey Mobster,

    I am sorry to hear you are running into this problem.

    Can you check your Control Panel and navigate to Admin->General Configuration and tell me what you have for URL to the root directory of your site? Do you have a trailing slash there?

    Are you using .htaccess? If so can you move that aside for testing?

    What do you get when you render {site_url}? I personally use {site_url} in my linking to avoid abs paths.

    Please let me know and we can go from there.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases