Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

404 issues. I think I am missing something

3:09 pm on May 1, 2010 (gmt 0)

Preferred Member from US 

10+ Year Member

joined:May 6, 2004
posts: 650
votes: 0

I have a bunch of sites I am migrating from frontpage to joomla. They are low traffic/low revenue sites.

Under fp, the urls were something like www.example.com/widget.htm. Under joomla, they are www.example.com/index.php/widget.html.
Many of these sites are on a shared virtual host and I have banged my head against the wall getting an htaccess rewrite to work. All I'm looking for is something simple to redirect people who are following old links to my index page.

I created a file called 404.html and put it in the root. That has a meta refresh to www.example.com.

However, I think I need to do some sort of return code that says that the page they originally were looking for is no longer available because what I am doing would probably return a 200 (found) code.

I was wondering if the following PHP code might be a better way of doing things

// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/");

I'd appreciate any thoughts on this. All I'm trying to do is to make the transition smoother and save some of the traffic while the search engines figure out the new site.


[edited by: phranque at 5:24 am (utc) on May 3, 2010]
[edit reason] exemplified urls [/edit]

10:55 am on May 4, 2010 (gmt 0)

New User

5+ Year Member

joined:May 4, 2010
votes: 0

A 301 redirect is definitely the good way to redirect your visitors
7:21 am on May 6, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
votes: 0

If path part of requested URL does not begin with /index.php then redirect to new URL with index.php inserted:

RewriteCond %{REQUEST_URI} !^/index.php
RewriteRule ^(.*)$ http://www.example.com/index.php/$1 [R=301,L]

While this will work, the Joomla URLs shouldn't really contain index.php in them. That's just laziness on the part of the designer.

You'll also need to add an exception (another RewriteCond) so that requests for images, CSS and JS files, robots.txt, etc, are not redirected this way. Whether you do this as a negative match on those, or a positive match on URL ending in .html is up to you.

Remove the 404 page with meta refresh. That's a very bad idea.
11:31 pm on May 6, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:May 22, 2008
votes: 0

If you can't get this to work properly, I can help. Each and every old URL will be 301 redirected to the new and corresponding Joomla URL.

This will enable you to keep any pagerank from the old site to your new site. Any old links on the net will get redirected flawlessly.
12:29 pm on May 7, 2010 (gmt 0)

Preferred Member from US 

10+ Year Member

joined:May 6, 2004
votes: 0

Thanks everyone. I still have a lot to learn in this area but I think I have it right now.

The sites weren't that big and I changed the folder/file structure a bit. That precluded a rewrite based on patterns such as g1smd suggested. However, it was only a couple of minutes of work to write seperate Redirect 301 lines for my old URLS redirecting them to a corresponding new URL. I checked the server status returns and they are showing them as 301s. I should see traffic increase and will keep some of the pagerank that accumlated over time.

G1smd - There is a way to configure Joomla to show www.mysite.com/folder/article.html instead of www.mysite.com/index.php/folder/article.html. I have to play with that a bit for future sites.

thanks again everyone.
5:08 pm on May 7, 2010 (gmt 0)

Junior Member

10+ Year Member

joined:May 22, 2008
votes: 0

cmendla, Joomla has two built in rewriting formats. To achieve the better URL format, i.e. .../folder/article.html you must enable URL rewriting.

The .../index.php/folder/article.html format does not require URL rewriting.

The option for this better format is found in Joomla's SEO settings called 'Use Apache mod_rewrite'.

I have a custom solution available that allows for you to easily rewrite any old URL from your html based sites to any given Joomla URL. As simple as editing a text based mapping file with comma separated old and new URLs:


Please note that such a solution is only worthwhile when you have decent pagerank on your old site that you simply don't want to lose after migrating to your new CMS website.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members