• Hi,

    I didn’t have a .htacces file but created one to enable pretty urls, I created a custom structure and then pasted the code that WordPress generated into my .htaccess. However now, images in my header.php and footer.php only display on my homepage, they do not display on any other page. Before I created the file all my header and footer images displayed correctly!

    .htaccess code looks like this:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    Is there a specific location where I should locate the .htaccess file? Do I have something missing from the file? Any help would be great! Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Anonymous User

    (@anonymized-3085)

    link to site please, and where did you place the htaccess file?

    Are you on a windows server?

    Thread Starter ger01

    (@ger01)

    link to site please, and where did you place the htaccess file?

    Can I PM you the link as the site is still under development.

    This is where I currently have .htaccess
    httpdocs > mywebsite >
    .protect
    wp-admin
    wp-content
    wp-includes
    .htaccess

    I have another WP website in httpdocs as well, if that makes any difference.

    Are you on a windows server?

    No I’m on a Linux server

    Anonymous User

    (@anonymized-3085)

    You are in a sub directory therefors your htaccess should look like this (I think):

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

    Thread Starter ger01

    (@ger01)

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

    If I use this for my .htaccess and have Default permalink settings selected it all works ok, but if I change the setting to anything other than default, images in my header.php and footer.php still do not display on all pages except for the homepage.

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

    If I use the code above, everything works as it should when I have default selected, however once I select anything other than default I get a 500 Internal Server Error!!

    ??

    I have a very distant memory that starting the rewrite rule twice is an issue, the rewrite engine should be on from the first pass of .htaccess in the root folder. Could be wrong on this, as I say just a memory from another issue I had with a demo site under our main site years ago. I don’t have that site any longer so I can’t go and check – sorry.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘trouble with htaccess file’ is closed to new replies.