Enabling SEF causes "Page not found" error

Need help with the Administration of your Joomla! site? Pop your questions in here.

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
willnewton
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Dec 12, 2007 9:13 am
Location: Braunton, UK
Contact:

Enabling SEF causes "Page not found" error

Post by willnewton » Wed Dec 12, 2007 9:38 am

Hi

I hope this is the right place for this post.

Having completed my site, I realised that I needed to enable SEF to make it Google friendly (or so I'm told).

On the Global Configuration page, I enabled "Search Engine Friendly URLs" after I'd checked that the .htaccess file was correctly named. However, on doing a site preview, I got this error message:

Not Found
The requested URL /content/view/23/39/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.39 Server at willnewton.com Port 80

I can't see anything else that I should have done - checked that the SEF mambot is published.

Have I missed something?

Being new at this, I'd appreciate any help.

Will

unbeleve
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Nov 21, 2007 11:57 pm

Re: Enabling SEF causes "Page not found" error

Post by unbeleve » Fri Dec 14, 2007 4:03 am

I have the same problem, hope we can get some help.

User avatar
kenmcd
Joomla! Champion
Joomla! Champion
Posts: 5672
Joined: Thu Aug 18, 2005 2:09 am
Location: California
Contact:

Re: Enabling SEF causes "Page not found" error

Post by kenmcd » Fri Dec 14, 2007 10:44 am

FIRST - Test if mod_rewrite is working
Having problems getting Joomla core SEF to work?
If mod_rewrite is not working, nothing else you do matters.
Test this first.

Test if mod_rewrite is working
Put only these two lines in your .htaccess file.

Code:
Options +FollowSymLinks
Redirect /google.html http://www.google.com

Now point your browser to: http://www.yoursite.com/google.html
If it redirects you to Google - mod_rewrite is working.
If it gives you an error - mod_rewrite is not working.

Note: Replace "www.yoursite.com" with your actual web site domain.

-----

If mod_rewrite is not working, check Apache configuration.

Apache requirements for mod_rewrite to work
The Apache httpd.conf file has the settings to enable URL rewriting.
Two settings are required.
1. mod_rewrite module is installed
Search file for LoadModule rewrite_module and un-comment that line (remove the leading #)
2. AllowOverride All
Search file for AllowOverride None and change it to AllowOverride All
It occurs in 2-3 different places; change all.
3. Restart Apache
Restarting the Apache web server is required for the changes to take effect.


SECOND - OpenSEF Simplified .htaccess File
After you have confirmed that mod_rewrite is working
Try this as your htaccess file:

Code: Select all

 
## OpenSEF Simplified htaccess File

## Can be commented out if causes errors
Options +FollowSymLinks

## enable mod_rewrite engine
RewriteEngine On

## If Joomla is installed in the web server root
## RewriteBase /
## If Joomla is installed in a sub-directory
## RewriteBase /directory_name_here
RewriteBase /

## Begin 3rd-Party or OpenSEF Section
#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 or OpenSEF Section

## Joomla Security Section (has nothing to do with SEF/SEO)
## 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 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
This is simply the J 1.0.12 htaccess file with the unneeded comment text removed and the standard Joomla core SEF rewrite section removed. What is left is just the lines of the file actually needed.
██ LibreTraining

willnewton
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Dec 12, 2007 9:13 am
Location: Braunton, UK
Contact:

Re: Enabling SEF causes "Page not found" error

Post by willnewton » Fri Dec 14, 2007 5:34 pm

Shows how much I know... my .htaccess file was blank.

Simply added the code above, saved & voila! I now have SEF URLs.

Thanks for the help.

i_smash_keyboards
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Aug 18, 2007 1:37 am

Re: Enabling SEF causes "Page not found" error

Post by i_smash_keyboards » Sun Dec 16, 2007 6:15 pm

Worked for me too. Thanks.

kehagiem
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu Mar 08, 2007 9:04 pm

Re: Enabling SEF causes "Page not found" error

Post by kehagiem » Wed Jan 02, 2008 5:13 pm

Happy New Year to every one in the community.

I have the same problem but I'm running on IIS server where .htaccess is not applicable. What do I have to check?

Thanks.

User avatar
kenmcd
Joomla! Champion
Joomla! Champion
Posts: 5672
Joined: Thu Aug 18, 2005 2:09 am
Location: California
Contact:

Re: Enabling SEF causes "Page not found" error

Post by kenmcd » Wed Jan 02, 2008 11:02 pm

kehagiem wrote: Happy New Year to every one in the community.

I have the same problem but I'm running on IIS server where .htaccess is not applicable. What do I have to check?

Thanks.
Two choices with J 1.0.xx on IIS:
- Find the thread about "SEF without mod_rewrite"
- Find the threads about using a rewrite extension for IIS (such as IIRF)
     
IIRF home page
http://www.codeplex.com/IIRF
██ LibreTraining

kehagiem
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu Mar 08, 2007 9:04 pm

Re: Enabling SEF causes "Page not found" error

Post by kehagiem » Thu Jan 03, 2008 3:00 am

Thank you for your quick response.

In case that I go for the Ionics Isapi Rewrite Filter do I still need a SEF component like sh404SEF?

Have  a nice day.

User avatar
kenmcd
Joomla! Champion
Joomla! Champion
Posts: 5672
Joined: Thu Aug 18, 2005 2:09 am
Location: California
Contact:

Re: Enabling SEF causes "Page not found" error

Post by kenmcd » Thu Jan 03, 2008 3:13 am

kehagiem wrote: In case that I go for the Ionics Isapi Rewrite Filter do I still need a SEF component like sh404SEF?

IIRF emulates on IIS the Apache mod_rewrite module.

The J 1.0.xx core SEF feature requires mod_rewrite.
If you want just the J core SEF URLs, IIRF would normally be required.
Or see the "SEF without mod_rewrite" hack thread mentioned above.

sh404SEF has a number of modes, some of which do not require mod_rewrite functionality (no IIRF).
So sh404SEF could be used on IIS without IIRF, but FURLs will include "index.php" in the FURL.
If you want the full text-based FURLs without the "index.php" you will need IIRF.
██ LibreTraining

kehagiem
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu Mar 08, 2007 9:04 pm

Re: Enabling SEF causes "Page not found" error

Post by kehagiem » Thu Jan 03, 2008 3:31 am

Thanks for your extensive explanation.
Regards,
Emmanuel

nrozas
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Sep 13, 2006 6:01 pm

Re: Enabling SEF causes "Page not found" error

Post by nrozas » Wed Jan 16, 2008 9:21 am

THX for the solution.

everything works ok now.

:D  ;)
"Perseguire, como busca el agua la sed, la estela de tu perfume"

southsider
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Sep 17, 2007 8:01 pm

Re: Enabling SEF causes

Post by southsider » Thu Jul 01, 2010 9:53 am

Thanks kenmcd putting you code into my .htaccess file solved my 404 error strait away!

mozardd
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Mar 07, 2011 3:28 am

Re: Enabling SEF causes

Post by mozardd » Wed Aug 24, 2011 2:51 am

Thank you!, kenmcd. Although, this thread was a several years ago, but your solution is work like a charm! thank you very much!

d3vlabs
Joomla! Explorer
Joomla! Explorer
Posts: 426
Joined: Thu Aug 18, 2005 10:41 am
Contact:

Re: Enabling SEF causes

Post by d3vlabs » Thu Oct 27, 2011 11:55 pm

i have installed IIRF on my IIS6/joomla 1.7 installation
can someone point me in the right direction to get it to work
it feels like im missing a step.

bobzilla
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Jan 06, 2010 7:24 pm

Re: Enabling SEF causes

Post by bobzilla » Fri Dec 02, 2011 12:15 am

Kenmcd thank you so much. Your simplified .htaccess worked a treat. I've followed what seems like every Joomla SEF post going and nothing worked. Must have been a speeling mistake somewhere.

Thanks again.

cis2daco
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Feb 16, 2012 8:14 pm

Re: Enabling SEF causes

Post by cis2daco » Thu Feb 16, 2012 8:25 pm

kenmcd
thank you very much, your written code for .htaccess was EXACTLY what i was looking for. many forums say "do this" or "do that". Kenmcd said "copy this" and use it.
i had been researching this for hours, this was very informative and best of all IT WORKED!
if there was a click to "donate" to a specific user i would! thanks again!

after a back/up restore from one hosting company to another i was on the dreaded "500 internal error". the primary index page would load, however the other links were not working. after some research i found that a temporary fix was to disable SEF within joomla, but that's all it was a "temporary fix". THE SOLUTION was to use joomla and have SEF enabled. this code for .htaccess from kenmcd did the trick. thanks again.

here's the site i duplicated from one hosting co to another, along with that i cloned to spanish as well.

http://creditrepairbyattorneyenespanol.net

regards,
Frank

xeeshansyed
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Apr 08, 2012 8:22 pm

Re: Enabling SEF causes

Post by xeeshansyed » Sun Apr 08, 2012 8:35 pm

there are few steps which should be fixed, first see the mode re-write is enabled or not, and 2nd is to change .htaccess to htaccess.txt, and if still not working see if you have installed some illegal or copyrighted plugins , coms, or extensions. and also set your root directory to "/" these are the steps i think should help if taken with care, and yes one more thing try to edit configuration.php, and set your live site variable with the value "www.yourdomain.com"

ravkt
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Wed Apr 04, 2012 9:39 am

Re: Enabling SEF causes

Post by ravkt » Sun Sep 23, 2012 12:31 pm

thank you kenmcd,


after wasting of my 3days time i found your post and i followed and resolved the issue... thank you so much...

ajaxhe
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Mar 17, 2014 11:09 am

Re: Enabling SEF causes

Post by ajaxhe » Mon Mar 17, 2014 11:14 am

kenmcd, Thanks for your solution! http://forum.joomla.org/images/icons/misc/heart.gif

ajaxhe
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Mar 17, 2014 11:09 am

Re: Enabling SEF causes

Post by ajaxhe » Mon Mar 17, 2014 11:15 am

kenmcd, Thanks for your solution!
kenmcd wrote:FIRST - Test if mod_rewrite is working
Having problems getting Joomla core SEF to work?
If mod_rewrite is not working, nothing else you do matters.
Test this first.

Test if mod_rewrite is working
Put only these two lines in your .htaccess file.

Code:
Options +FollowSymLinks
Redirect /google.html http://www.google.com

Now point your browser to: http://www.yoursite.com/google.html
If it redirects you to Google - mod_rewrite is working.
If it gives you an error - mod_rewrite is not working.

Note: Replace "www.yoursite.com" with your actual web site domain.

-----

If mod_rewrite is not working, check Apache configuration.

Apache requirements for mod_rewrite to work
The Apache httpd.conf file has the settings to enable URL rewriting.
Two settings are required.
1. mod_rewrite module is installed
Search file for LoadModule rewrite_module and un-comment that line (remove the leading #)
2. AllowOverride All
Search file for AllowOverride None and change it to AllowOverride All
It occurs in 2-3 different places; change all.
3. Restart Apache
Restarting the Apache web server is required for the changes to take effect.


SECOND - OpenSEF Simplified .htaccess File
After you have confirmed that mod_rewrite is working
Try this as your htaccess file:

Code: Select all

 
## OpenSEF Simplified htaccess File

## Can be commented out if causes errors
Options +FollowSymLinks

## enable mod_rewrite engine
RewriteEngine On

## If Joomla is installed in the web server root
## RewriteBase /
## If Joomla is installed in a sub-directory
## RewriteBase /directory_name_here
RewriteBase /

## Begin 3rd-Party or OpenSEF Section
#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 or OpenSEF Section

## Joomla Security Section (has nothing to do with SEF/SEO)
## 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 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
This is simply the J 1.0.12 htaccess file with the unneeded comment text removed and the standard Joomla core SEF rewrite section removed. What is left is just the lines of the file actually needed.

susqunkral
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Mar 22, 2014 8:14 pm

Re: Enabling SEF causes

Post by susqunkral » Sun Mar 23, 2014 11:48 am

ajaxhe wrote:kenmcd, Thanks for your solution!
kenmcd wrote:FIRST - Test if mod_rewrite is working
Having problems getting Joomla core SEF to work?
If mod_rewrite is not working, nothing else you do matters.
Test this first.

Test if mod_rewrite is working
Put only these two lines in your .htaccess file.

Code:
Options +FollowSymLinks
Redirect /google.html http://www.google.com

Now point your browser to: yabanci dizi izle

If it redirects you to Google - mod_rewrite is working.
If it gives you an error - mod_rewrite is not working.

Note: Replace hd yabanci diziler with your actual web site domain.

-----

If mod_rewrite is not working, check Apache configuration.

Apache requirements for mod_rewrite to work
The Apache httpd.conf file has the settings to enable URL rewriting.
Two settings are required.
1. mod_rewrite module is installed
Search file for LoadModule rewrite_module and un-comment that line (remove the leading #)
2. AllowOverride All
Search file for AllowOverride None and change it to AllowOverride All
It occurs in 2-3 different places; change all.
3. Restart Apache
Restarting the Apache web server is required for the changes to take effect.


SECOND - OpenSEF Simplified .htaccess File
After you have confirmed that mod_rewrite is working
Try this as your htaccess file:

Code: Select all

 
## OpenSEF Simplified htaccess File

## Can be commented out if causes errors
Options +FollowSymLinks

## enable mod_rewrite engine
RewriteEngine On

## If Joomla is installed in the web server root
## RewriteBase /
## If Joomla is installed in a sub-directory
## RewriteBase /directory_name_here
RewriteBase /

## Begin 3rd-Party or OpenSEF Section
#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 or OpenSEF Section

## Joomla Security Section (has nothing to do with SEF/SEO)
## 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 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
This is simply the J 1.0.12 htaccess file with the unneeded comment text removed and the standard Joomla core SEF rewrite section removed. What is left is just the lines of the file actually needed.
Thanks to you i fixed the problem.


Locked

Return to “Administration - 1.0.x”