Home arrow sh404 Guide - 3
Install sh404 Guide - 3

Install sh404 Guide - 3

Install sh404Guide - 1                          Page 1 of the sh404 manual
Install sh404Guide - 2                          Page 2 
Install sh404Guide - 3                             Page 3 [this page]
Visual Guide to sh404 Metadata           A step-by-step guide to enabling meta in sh404

On this page:

3 - More sh404 topics
The sh404 security layer
The Flooding Block
sh404 on Joomla 1.5
General advice and tips
Joomla ItemID issues
sh404 bugs
An htaccess file example for sh404
1&1 hosting
Core SEF or 3PD SEF
Troubleshooting guide for sh404

3 - More sh404 topics

The sh404 security layer

A Joomla site with sh404 is more secure, as the plugin adds some good security features. Many types of attacks are rejected even before the site can be accessed. 

The Flooding Block

One of the security measures built in to sh404SEF is a flood block. What this does is to reject requests from an IP that overloads the server.
You will normally need to set this higher than the default, otherwise you will often find yourself blocked. The two most common times are when editing content and when using a forum. During these processes a lot of HTTP requests get bundled together and that will trigger the flood blocker. Set the parameters higher - try 20 + 20.
The default settings are 10 + 10, ie 10 requests within 10 seconds; so try 20 requests in 20 seconds. Essentially this is the same setting but gives a longer timeframe. When you click to save your work, in the CMS wysiwyg editor, that can send more than 10 requests immediately. Forum posts are the same - occasionally a post will fail due to the flood block, with the default settings. 

sh404 on Joomla 1.5

There is now a native version for the Joomla 1.5 series. However full support for J1.5 plugins may take a little longer to materialise (sh404 supports many important J1.0 series plugins, with additional features).

General advice and tips

Upgrade Joomla to the latest version of the series you prefer.

Upgrade sh404SEF to the latest version for your Joomla series.

Don't go on the sh404 forum asking for help and solutions to issues unless you are sure that you have the latest versions - you are wasting everybody's time. Issues get fixed regularly and yours might have been too.

Install sh404 before ANY other extension except Joomfish.

If the sh404 'with htaccess' option doesn't work on your site / server straight off - then revert to the Joomla core SEF solution and get that working first. If the core SEF solution doesn't work then sh404 won't. It's easier to resolve server and htaccess problems using the core SEF first. If the core SEF solution does not work, then it is not the fault of sh404 if you have problems.

Joomla ItemID issues

There is one annoying bug in Joomla 1.0 that means some pages will publish with an itemID of 1, the same as the front page. This leads to all sorts of problems. Here are a couple of tips to help avoid this.

In sh404, in the main configs., have all checkboxes for ItemID Management set to NO.

Create 'official' Joomla menus for all your content items. Don't just have items (ie pages) linked out of text. On first publication, make sure to open the item / page via the Joomla menu first, before you click any text link for it.

If a page still gets created with itemID 1, then choose the first duplicate URL offered for that page and select it as the main URL. This is normally the correct one. A page that 'thinks' it is itemID 1 will always have an alternative URL for you to pick instead.
(In View SEF URLs >> select second URL in list >> Duplicate URLs, at top right >> check second URL >> save and exit.) Unfortunately this information - for all pages - will be lost when the cache is flushed. This is an sh404 bug, since the info should go into the database and be locked, not allocated as temporary data that can be flushed.

sh404 bugs

No software is perfect and this applies to sh404. We think it's the best thing since sliced bread, but of course there are some bugs.
1. ItemID 1 allocated to multiple pages
There should be a function that prohibits the allocation of ItemID 1 to any content item except the front page. Or, to have ItemID 1 allocatable to any item - but only to any one item. Joomla has a problem with allocating this ID multiple times. It's a serious core bug; but the effects may be worse in sh404. It can happen that 1 in 3 new content items get allocated the same ID as the index page. There needs to be a way to stop this. The bullet-proof solution provided, to add a unique ID to the URL, works but is too clunky.

2. Corrected ItemIDs are lost when the cache is flushed
Yes, you can choose the ItemID to be allocated to any content item, ie the Main URL to choose for any page. This is an excellent feature. Unfortunately, this information is lost every time you purge the SEF URLs. That means whenever you purge the URLs - which might be every time you change any detail anywhere - all the ItemIDs are lost. You then have 100 pages that think they are the index page again. This bug needs fixing.

3. The missing 404 page
This does not seem to affect the Joomla core so unfortunately it has to be laid at the feet of sh404. The text contents of the 404 page (which is in Static Content) are regularly lost for some reason - an annoying bug. The fix is to create another 404 page with a slightly different URL - like 404-error.html - and set that as the default sh404 error page. This might get 'lost' but the real one stays intact. 

An htaccess file example for sh404

Here is a simple, basic htaccess file for sh404. This is the minimum that needs to be included to get sh404 to work. There is a lot more that could - and should - be included in an htaccess file. You can ask your SEO consultants or maybe your site hosts what else should go in there - this is their game.
In the file below, the first line (RewriteEngine On) is always included even though it may not be necessary - it does no harm.
The second line may be necessary (Options +FollowSymLinks) if it has not been included in the server's main config file - so if your htaccess file doesn't work, then uncomment this line so that it is operational. if there is still no result, comment it out again and proceed to the next step.
The third line (RewriteBase /) is only necessary on a few servers. Again, uncomment it if previous efforts don't work. If no result, try both of those lines uncommented.
Note that this line, RewriteBase /, often needs a folder level added so that the server knows exactly how to rewrite the base URL. Your site hosts will assist. For example this is required by sites on 1&1 hosting. These servers have a different path to the web files from normal, so a standard htaccess file doesn't work; only they can tell you how to fix it. Sometimes their user forum will be a good source of information here, as many other people will have been down this road before you.
1&1 hosting
You need to uncomment the following line:
# RewriteBase /

...so that it looks like this:
RewriteBase /

If you have Joomla installed in a folder, not in the webroot (which may happen with installer scripts like Fantastico), then you'll need this:
RewriteBase /your-folder-name

Core SEF -OR- 3PD SEF !!!
The main section of the file is for 3rd-party SEF solutions such as sh404 (3PD = 3rd-party developers). It is different from the core SEF htaccess requirements - and both should not exist at the same time! Don't laugh, I've seen it... The site still works but there are errors.
The following htaccess is for sh404 and other 3PD SEF solutions. It is not for use with the core SEF solution.
## htaccess file for sh404SEF
RewriteEngine On
## uncomment the following line if necessary
# Options +FollowSymLinks
## uncomment the following line if necessary
# RewriteBase /
## Joomla 3PD SEF
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php

Go to this page for more help with htaccess files 

sh404 troubleshooting section

sh404 Q & A

Q: The page has a format error when I use sh404. How to fix it ?
A: If there are formatting issues then it looks as if the page has got the wrong itemID. sh404 cannot alter the page content in any way, there is nothing in it to do that with. So it sounds like your page has the wrong ID and looks like another page should - ie with the wrong modules published or unpublished. Fix the ItemID error (try flushing the URL cache first).

Q: I changed various page elements but nothing has changed on the site. I think it's sh404, how can I fix it ?
A: Flush the URL cache - it holds more than URLs in practice because it holds the 'old' way a page looked before you changed the SEF URL etc.

Q: The URL still shows a Category level even when sh404 is set to 'category = no'.
A: You have set it to 'No', but then not flushed the cache.

You must flush the URL cache - delete all SEF URLs. This is the working memory of SEF page addresses that is used for all new page addresses, and it must be rebuilt every time a major config change is made. Delete the URL cache via the icon on the main sh404 panel. Then rebuild it by either clicking a page that displays every single Joomla menu on the site, or running a sitemapper app - which essentially does the same thing.

The SEF URL cache must be flushed and rebuilt every time you change the configs. No changes will show up unless you rebuild the cache. The site will still show exactly as before, whatever configs you change, until you rebuild the cache, which is the master configs list if you like.

Q: Do I turn on 'Show duplicate page URLs' or not ?
A: Not if your site runs without problems - you can ignore this. However some sites have an issue with the itemID of #1 being wrongly issued to another page. If this happens your new page looks like the index page :( 

To fix it, you turn on 'Show duplicate URLs', click through some pages to get them registered, check the SEF URL list, pick the first duplicate URL below the top one for the page (which will show several page hits), select it as the Main URL, and Save. That one is normally the correct one. Make a note of the real ItemID because you will lose that selection every time you flush the URL cache, and it will have to be fixed again.


Step-by-step troubleshooting guide for sh404

Here is a step-by-step procedure for fixing a situation where you install sh404 but you can't get full SEF URLs. It is slow, methodical, and maybe tiresome - but it's the only way to help you fix it. This routine is for Joomla 1.0.15 but it's essentially the same for Joomla 1.5.x.

1. You install sh404 but it doesn't work.

2. Ensure you are using the latest Joomla 1.0 series version, which (at this time) is 1.0.15
Ensure you are using the latest sh404 version, which is
com_sh404SEF_1.3.9_build_357.joomla1.0.x.zip -- of size 426.41 Kb.

3. Does the core SEF solution work?

The 'core SEF solution' is Joomla's built-in short URLs arrangement. It needs enabling in the admin configs, and the htaccess file on the server renamed from htaccess.txt to .htaccess .

But you can take a quick shortcut at this point:

4. We can also see if sh404 works without an htaccess file. To do this, ensure that in Joomla admin, Global Configs >> SEO tab >> Search Engine Friendly URLs = YES
in Joomla admin, Components >> sh404SEF >> sh404SEF Configuration >> Main tab >> Enabled = YES
Advanced tab >> Advanced Component Configuration >> Rewriting mode = WITHOUT .HTACCESS (INDEX.PHP)

Do SEF URLs work now? They should be much shorter and cleaner than the normal CMS raw URLs. There will be an /index.php/ in the middle of the URL.

If this works we know that Joomla is OK, sh404 is OK, the server is working OK with both. However - we could still be on an unusual server, such as a Windows IIS server, since Joomla and sh404 still both work in this situation. If it's a Windows server it must have PHP and MySQL installed on it or Joomla won't work.

If this doesn't work then we've got problems. This is a rare situation. You have a non-standard server and you need to contact your hosts and ask for advice. Is it a Sun, Zeus, NginX or Lighttpd server? Is it running a standard Linux distro or Unix - or something else? Is it an unmanaged dedicated server, and not fully set up? Only your hosts can help here, as the server is non-standard.

However, we are talking here STRICTLY and ONLY about a new, standard Joomla 1.0.15 series installation, with the latest version of sh404, with the cms INSTALLED DIRECTLY TO THE WEBROOT and not in a directory (a folder), and with NO OTHER PLUGINS.

If this does not apply - then it may give you a clue as to where the problem is.

Assuming that the conditions above are in force, unless you have made a mistake in your settings, you cannot go forward from here without assistance from your hosts. Your server is non-standard.

4. If sh404 works without an htaccess file, this is a good sign. But before we try and sort out the sh404 htaccess situation, we have to get the core SEF solution working on htaccess first. Trying to do it with sh404 running adds another layer of complexity that we don't need.

Switch OFF sh404 if it's enabled.
Leave Joomla global configs, SEO, SEF URLs = YES
If not enabled then enable it. Enable = switch on = YES.

Connect to your site via FTP.
Change the filename of the htaccess file, from htaccess.txt to .htaccess
That's DOT-htaccess
(highlight the file >> right-click it >> choose 'Rename' >> type a new name).
Check the livesite. Click through the site and now you should see shorter URLs, not the long raw ones. But the URLs are still very clunky.

5. If the URLs have not changed and are still raw (very long, with numbers, underscores, and queries in), then something needs fixing in the htaccess file.
Make a backup of the htaccess file.
In turn, testing each time, uncomment the following lines:

# RewriteEngine On
# Options +FollowSymLinks
# RewriteBase /

To 'uncomment' means to remove the # at the start of the line. If there is a hash symbol, the server ignores that line. So, to comment-out a line, you insert a hash at the start.

If you installed Joomla with Fantastico, the auto-installer that hosts often provide, then the last line may need to be uncommented and look like this:

RewriteBase /joomla

6. If no version works correctly then:
a. You may have an incompatible plugin that is causing problems. Disable (or better still, uninstall) your plugins and get the SEF situation working first. Then install the plugins, testing as you go, and you will find which one is the problem.
b. Or, you are on a non-standard server - you must contact your hosts for examples of htaccess files for your particular server. You cannot go forward until they assist you.

For example you may be on an unusual server set-up that needs this version of the second line above:

Options ExecCGI +FollowSymLinks

[this was seen on a Hostgator Joomla site]
Only your hosts can assist here. However there may be a support forum - you could ask on there if anyone has an htaccess file THAT WORKS FOR JOOMLA 1.0 (or 1.5). It's a lot easier to get a working example than trying to discuss fixes.

7. If nothing works and your Joomla install is in a directory, eg with a filepath like:

...then you can try another step - install it properly, direct to the webroot, not in a folder. Then, the filepath will be, correctly:

Uninstall Joomla -
Delete the folder /joomla/.
Drop (delete) the database.
Create a new database. Save all account details carefully.
Install Joomla TO THE WEBROOT. This means in the best way rather than in a folder (directory) - all files in the webroot, not in a folder.
To do this, download Joomla 1.0.15 from joomla.org .
Unzip the package on your PC.
Open the Joomla folder and FTP all the included files and folders up to the webroot. This means all the files etc are loose in the webroot, not in one single folder. This is how it is supposed to be, and the best way to install a CMS. (The auto script installer takes an easier option.)

Now try the whole procedure again - this time the CMS is installed better and you might strike lucky.

If core SEF URLs don't work by this procedure then you're stuck: you have a non-standard server or have made a mistake somewhere. You only have these options:
a. Ask your hosts for help with the htaccess file.
b. Find a CMS mentor who will help you sort it all out - someone experienced who can find what the issue is.
c. Pay a professional CMS sysadmin to sort it out for you.

7. If the core SEF works then let's try sh404's htaccess solution.
FTP the htaccess file down to your PC.
Ensure you have a backup of it.
Comment-out the core SEF lines and uncomment the 3PD SEF lines in the file. See above or on previous page for how to do this.
Or, use the 3PD htaccess file we provide on one of these pages.
FTP it up to the webroot.

Check the livesite. You should now see perfect URLs (depending on how well your URL parameters are set up). You don't want underscores or upper case letters in there of course.

If the sh404 SEF URLs don't work then there is an issue with the 3PD htaccess version for your server, or with a plugin that is causing an issue.

If the htaccess file for the core SEF had to be varied IN ANY WAY from the normal version, then this indicates a server issue of some kind.

If not then look at the plugins.


Our sh404 Manual continues with a page on enabling the metadata - see the menu at top right.
We hope this tute helped you out - more info will be included as and when!
Tell us what you need to know and we'll include it. Use the forum.
Please visit the sh404 project page and donate to the project.

Web Business Managers