[TYPO3-install] Re: TYPO3 CMS 6.2.4 LTS Error: HTTP 404 Not Found

Mark Danmark Dutchice at hotmail.com
Tue Aug 19 17:01:53 CEST 2014


To whoever might encounter this same issue in the future, here is the solution to the HTTP 404 Not Found error for TYPO3 CMS 6.2.4 LTS on CentOS 7.0 x64.

Unlike many posts suggesting the use of 'a2enmod rewrite' to enable the mod_rewrite module on apache, this syntax is not valid for RHEL/CentOS platforms running Apache/2.4.

STEP 1: Logon with full administrative privileges (root) on your system/VPS
STEP 2: Verify the two required apache modules being loaded by typing: httpd -M
STEP 3: You must be able to see 'rewrite_module' and 'expires_module' in the list of loaded apache modules.
STEP 4: Edit the /etc/httpd/conf/httpd.conf file by adding the following to the very end of it (where /var/www/html must be replaced by the directory where you have your TYPO installed):
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
STEP 5: Restart apache by typing: apachectl restart
STEP 6: View the contents of your /var/www/html/.htaccess file (replace /var/www/html with your own TYPO installation directory) and make 100% sure that the following lines are in it and are not commented out:
<IfModule mod_rewrite.c>

    Options +FollowSymlinks

    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
    RewriteRule ^fileadmin/(.*/)?_recycler_/ - [F]
    RewriteRule ^fileadmin/templates/.*(\.txt|\.ts)$ - [F]
    RewriteRule ^typo3conf/ext/[^/]+/Resources/Private/ - [F]
    RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]

</IfModule>
STEP 7: Try out your TYPO3 frontend to verify if the HTTP 404 issue is resolved.

I recommend using the .htaccess file that came with the preconfigured distribution package (Kickstart/Introduction package) you chose to install. For the Official Introduction Package of TYPO CMS 6.2.4 LTS this file could be found at /typo3conf/ext/bootstrap_package/Configuration/Apache/.htaccess You need just to copy this file to the root of your TYPO website directory.
In order to run a quick test to see if your apache is configured and working well with the mod_rewrite enabled for the root of your TYPO website, (isolating the problem to TYPO by confirming apache is doing its part right) I recommend:
STEP 1: temporarily renaming your current .htaccess to _htaccess then making a new .htaccess file with only the following lines:
RewriteEngine on
RewriteRule ^oranges.html$ apples.html
STEP 2: Copy the code below and save it as apples.html on your website root;
<html>
  <head>
    <title>Apples</title>
  </head>
  <body>
    <h1>This page is about Apples</h1>
  </body>
</html>
STEP 3: Make a new file named oranges.html on your website root by copying the above code again but this time substituting 'Apples' with 'Oranges'.
STEP 4: Verify if your mod_rewrite is enabled and working by browsing to www_yourTYPOwebsite_com/oranges.html you should see the Apples page instead of Oranges if all is good.
STEP 5: If the test was successful then delete the 3 files you just created and rename your _htaccess file back to .htaccess You can now be sure your apache is doing its job right.

Hope this would help someone in the future and save him the 5 days I had to spend by myself in finding where were things going wrong.



More information about the TYPO3-install mailing list