logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: SEF URLs in JOOMLA stopped working after upgrade PHP
Author
dclarke



Joined: 09 Feb 2016
Posts: 12

PostPosted: Fri 14 Dec '18 0:27    Post subject: SEF URLs in JOOMLA stopped working after upgrade PHP Reply with quote

Hey,

I am currently hosting several Joomla sites on a Ubuntu 16.04 LTS LAMP server. I am using Joomla 3.9, Apache/2.4.37, PHP 7.1 and MySQL. We recently configured SEF URLS through Joomla successfully.

However yesterday I was doing updates/upgrades on the web server specifically PHP from 7.0 to 7.1 following this article here:

https://jakelprice.com/article/how-to-u ... -to-php-71

During this upgrade to PHP 7.1 it also seemed to pull some updates for APACHE now it appears all of our SEF urls that were working are no longer working and giving a error:

Not Found
The requested URL /government-relations was not found on this server.

I have gone through the same steps that we originally went through when we were successful but it still does not work. Any help would be greatly appreciated.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 14 Dec '18 12:03    Post subject: Reply with quote

It seems that the url rewriting is no longer working. You may check if .htaccess files are allowed to override the server config.
Back to top
dclarke



Joined: 09 Feb 2016
Posts: 12

PostPosted: Fri 14 Dec '18 18:46    Post subject: Reply with quote

James Blond wrote:
It seems that the url rewriting is no longer working. You may check if .htaccess files are allowed to override the server config.


Any additional details would be nice, I am new to this and it was working so were would I check for those changes?

Thanks in advance.
Back to top
dclarke



Joined: 09 Feb 2016
Posts: 12

PostPosted: Fri 14 Dec '18 18:50    Post subject: Reply with quote

Are you talking about the .htaccess file in the joomla root directory? There is a .htaccess file in all the different root directories for all our joomla websites, but none of the websites SEF URLS are working so it appears to be a global server issue.

If you can tell me what file to look at and where I can do that but would need some additional details. We are using Ubuntu 16.04 LTS, no GUI all command line


Thanks
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 14 Dec '18 19:26    Post subject: Reply with quote

dclarke wrote:


Any additional details would be nice, I am new to this and it was working so were would I check for those changes?



Write anyhting like gargabe in the .htaccess file, if the servers reads the file the server should return a 500 error.

And yess the .htaccess file in the joomla root.
Back to top
dclarke



Joined: 09 Feb 2016
Posts: 12

PostPosted: Fri 14 Dec '18 19:35    Post subject: Reply with quote

I thought those changes needed to be made in my apache config, if not I apologize. Her is the contents of the .htaccess file for one of our Joomla sites:

##
# @package Joomla
# @copyright Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line 'Options +FollowSymLinks' may cause problems with some server configurations.
# It is required for the use of mod_rewrite, but it may have already been set by your
# server administrator in a way that disallows changing it in this .htaccess file.
# If using it causes your site to produce an error, comment it out (add # to the
# beginning of the line), reload your site in your browser and test your sef urls. If
# they work, then it has been set by your server administrator and you do not need to
# set it here.
##

## No directory listings
<IfModule autoindex>
IndexIgnore *
</IfModule>

## Can be commented out if causes errors, see notes above.
Options +FollowSymlinks
Options -Indexes

## Mod_rewrite in use.

RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site then comment out the operations listed
# below by adding a # to the beginning of the line.
# This attempts to block the most common type of exploit `attempts` on Joomla!
#
# Block any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root home page
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

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

RewriteBase /nasbonline.org

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.


Again this was all working fine with this same .htaccess file until I updated my PHP from 7.0 to 7.1.

Thanks for any help.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 17 Dec '18 20:43    Post subject: Reply with quote

Okay, since you did not try the a not working command in the .htaccess file, we do not know if apache eats that file.

however I think it is more likely that your joomla version is not compatible with that PHP version. But the docs says your version supports newer php versions.

which extension do you use for SEF?
Back to top
dclarke



Joined: 09 Feb 2016
Posts: 12

PostPosted: Mon 17 Dec '18 22:57    Post subject: Reply with quote

James,

Sorry I forgot to post I did the garbage test and it did result in a error 500. I am using the built in Joomla SEF URL's not 3rd party extensions.

Thanks for your continued help.
Back to top
gijs



Joined: 27 Apr 2012
Posts: 189
Location: The Netherlands

PostPosted: Wed 26 Dec '18 15:11    Post subject: Reply with quote

Make sure your httpd.config or virtualhost has the following setting: AllowOverride all
This setting tells Apache to check for a .htaccess file.

Additionally make sure mod_rewrite is enabled, as this is required for Search Engine Friendly URL's.
Back to top


Reply to topic   Topic: SEF URLs in JOOMLA stopped working after upgrade PHP View previous topic :: View next topic
Post new topic   Forum Index -> Other Software