Results 1 to 6 of 6

Thread: Contao generating 404 errors

  1. #1
    New user
    Join Date
    09-03-15.
    Posts
    9

    Default Contao generating 404 errors

    I have a Contao installation and from the site all the links work no problem.
    When I run the site from the https://validator.w3.org LinkChecker and from Google Search Console, all the links generate 404 errors and my website is not crawled probably. All sites are included in the Sitemap.

    Using Contao 3.5.2 and here is a link to the website: link removed

    Can someone give me a direction in to why this is happening?
    Last edited by j.wasilenko; 09/23/2015 at 09:06.

  2. #2
    New user
    Join Date
    09-03-15.
    Posts
    9

    Default

    Been searching for solutions and have come up with this.
    My Contao settings are all correct, the URL suffix is not displayed, which is what I want.

    But if I uncomment:
    # RewriteRule .* index.php [L]

    From the .htaccess file, then the 404 errors are all fixed but the .css files, and images are not loaded anymore.

    The search continues.

  3. #3
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    This should work as commented in the .htaccess file
    PHP Code:
    RewriteCond %{REQUEST_FILENAME} !\.(htm|php|js|css|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|mp4|webm|ogv|mp3|ogg|oga|eot|otf|tt[cf]|woff2?|svgz?|pdf|gz)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond 
    %{REQUEST_FILENAME} !-d
    # simple
    RewriteRule .* index.php [L]
    # optimized
    # RewriteRule (.*)$ index.php/$1 [L] 
    see also https://github.com/contao/core/issues/4031
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

  4. #4
    New user
    Join Date
    09-03-15.
    Posts
    9

    Default

    That didn't work for me but thank you. I copied an old .htaccess file from another contao installation and it worked. Not sure which line was causing the issue but the old htaccess set everything right.

  5. #5
    New user
    Join Date
    01-08-16.
    Posts
    11

    Default 404 error sitemap "item" missing from path

    My sitemap seems to be creating incorrect paths for all news or newsletter archive items.
    The path that should appear in the sitemap.xml file should be of the form http://<domain.name>/index.php/news/items/<news article> for each news article but what is appearing is http://<domain.name>/index.php/news/<news article> and so google search console keeps complaining about Soft 404.

    I'm using Contao 3.5.4, any insight would be most appreciated.

  6. #6
    User Andreas's Avatar
    Join Date
    07-11-09.
    Location
    Mönchengladbach
    Posts
    499

    Default

    First you should update to 3.5.6. This can easily be done with extension easyupdate3. Then you should try in safe mode which disables all extensions. Then you also can try the option "enable auto_item".

    What is the reason for wanting index.php in your URL? Without it URLs look more friendly and readable.
    Code:
    example.org/index.php/my-page.html
    example.org/my-page.html
    Don't forget to rename your .htaccess.default to .htaccess.

    If in the end you can say that it's a bug (tried with a clean installation) you can open a ticket at github.
    Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
    Amazon wishlist

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •