Over the last couple of years I have taken over a website made up of several parts, ie there were some traditional html pages, a php “wiki” installation and a similar php “knowledgeable” installation.

I have redesigned the site and converted the old html part of the site to Joomla.

At present the new Joomla website calls in the wiki php functionality into Joomla using the “URL” menu type.

However, to me, there is no longer a need for this wiki installation and would like to bring all the wiki pages into Joomla. Regarding the content, this is not a difficult task - it’s a simple copy and paste job from the wiki into Joomla articles.

The problem I have is that the wiki pages rank well in Google, and I need to ensure that above all else that the pages do not lose ranking as we swap the pages into Joomla.

The wiki itself does have a redirect plugin which I’ve set up, and it works, but Google is still listing the old URLs and not the new URLs.

I have tried creating redirects via htaccess in the root folder, but it’s not working as I was hoping.

Here is the redirect I have tried in htaccess:

Redirect 301 /phpfolder/doku.php?id=mydocument https://www.mysite.co.uk/new-category/2 ... joomla-doc

I've tested it several times and as soon as the "?id=mydocument" goes in after the doku.php the server completely ignores the redirect and serves the original wiki page and not the new Joomla page.

Does anybody have any suggestion on how I can resolve this to avoid the original wiki pages losing ranking and to get Google to recognise the new pages and deindex the old pages?

Any help, as always, greatly appreciated.


  • Hello Dunxmax. Welcome to JSE. Please note that although it is possible someone may answer your question, it is considered as off-topic for this site, as it's no related with Joomla, as described in our help center. I won't flag or close your question and will let the community to decide for now, but please make sure you have read the site's help and rules: help center. Finally, regarding your problem how many pages your wiki has? Are you planning to create manually redirects one by one for each of all the old wiki pages?
    – FFrewin
    Jul 24, 2018 at 10:59

2 Answers 2


Normal redirects ignore query strings. You have to set a condition for the page and the query string:

RewriteCond %{REQUEST_URI} ^/phpfolder/doku.php
RewriteCond %{QUERY_STRING} ^id=mydocument$
RewriteRule (.*) https://www.mysite.co.uk/new-category/whatever/joomla-doc? [R=301,L]

Putting the ? at the end strips off the original query string, otherwise it would show https://www.mysite.co.uk/new-category/whatever/joomla-doc?id=mydocument

If you have a ton of different queries that go to the same place, it is possible to use regex to match them all together.


You could look into joomla admin tools, its the best security component for Joomla but also has a really nifty feature for handling redirects. Its much cleaner than an enormous .htaccess file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.