SOLVED: URL rewriting causes 404 error

Discuss Search Engine Optimization in relation to Joomla! 2.5. This forum will also have discussions on SEF/SEO Joomla! 2.5 extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
unimundo
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jul 28, 2014 3:49 am

SOLVED: URL rewriting causes 404 error

Post by unimundo » Mon Jul 28, 2014 3:55 am

Hi,

I have just moved the website to another server.
And I see 404 error on pages
Not Found

The requested URL /home-page was not found on this server.

Apache/2.2.15 (CentOS) Server at unimundo.tv Port 80

However, mod_rewriting is on in Apache configuration file, .htaccess is standard and seem to be correct

Code: Select all

##
# @version $Id: htaccess.txt 4756 2006-08-25 16:07:11Z stingrey $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##

##  Can be commented out if causes errors
Options FollowSymLinks

#
#  mod_rewrite in use

RewriteEngine On

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla/MamboDirectory (just / for root)

#RewriteBase /

########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla! 

core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc
#
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] 		

##optional - see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed 

below
## This attempts to block the most common type of exploit `attempts` to 

Joomla! 
#                              
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
# 
########## End - Rewrite rules to block out some common exploits
Please assist me in this issue
Last edited by unimundo on Mon Jul 28, 2014 8:00 pm, edited 1 time in total.

User avatar
ionut
Joomla! Ace
Joomla! Ace
Posts: 1264
Joined: Thu May 27, 2010 1:00 pm
Location: EU

Re: URL rewriting causes 404 error

Post by ionut » Mon Jul 28, 2014 4:46 am

Have you followed the steps from the docs? http://docs.joomla.org/Enabling_Search_ ... RLs#Apache

unimundo
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jul 28, 2014 3:49 am

Re: URL rewriting causes 404 error

Post by unimundo » Mon Jul 28, 2014 1:55 pm

Yes, I followed those steps but the issue remains.
mod_rewrite is loaded, htaccess is renamed and seems to be correct.
I'm wondering maybe I have to install something on my server, as problem appeared when I moved to a new server?



Kind Regards

unimundo
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Jul 28, 2014 3:49 am

Re: URL rewriting causes 404 error

Post by unimundo » Mon Jul 28, 2014 7:57 pm

Solved!
A had to edit Apache conf file and change AllowOverride ALL (<- in two places)

Apache simply didn't use my .htaccess file


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 2.5”