WordPress.org

Ready to get started?Download WordPress

Forums

FG Joomla to WordPress
Modify internal links not working after succesfull import (7 posts)

  1. 66halo66
    Member
    Posted 6 months ago #

    Hello, Frédéric.
    I am using WordPress 3.8 on Ubuntu 12.04.

    When I Import from the Joomla 1.5.14 to WordPress everything seems to be imported correctly(category, pages(I set the "Import as pages instead of blog posts") and medias).All good up to this point.

    My main problem is that I have a lot of internal links between pages and when I imported the first thing I did was to :
    1) Remove the prefixes from the categories
    2)Modify internal links

    The interal links don't point to the right pages(only about 10 % of the overall number of links pointed to the correct page).Please assist me on this matter.
    The other problem I had was, when I tried to access http://localhost it started loading untin an error printed on the screen saying:
    "
    This webpage has a redirect loop

    The webpage at http://localhost/sms-bill/shema4_smsobiavi/ has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
    Learn more about this problem.
    Error code: ERR_TOO_MANY_REDIRECTS "

    Now, I don't understand why it loads this page(it's not set as the default landing static page in the "Customization" tab in the admin panel).

    http://wordpress.org/plugins/fg-joomla-to-wordpress/

  2. Kerfred
    Member
    Plugin Author

    Posted 6 months ago #

    For the internal links, please double check what you filled in the URL field. You must put the URL of the Joomla home page.

    For the redirect loop, I can't help you because it is not related to the plugin.

  3. 66halo66
    Member
    Posted 6 months ago #

    this is what I filled in the URL field:

    http://i41.tinypic.com/mviy2o.gif

    this is(at least I think) the URL of the Joomla homepage

  4. 66halo66
    Member
    Posted 6 months ago #

    Edit: I resolved the problem with redirect loop - I added www to the URL, but the main problem with the internal links still stands.

  5. Kerfred
    Member
    Plugin Author

    Posted 6 months ago #

    Can you show me an example of an internal link that is in a Joomla article and that is not converted properly?

  6. 66halo66
    Member
    Posted 6 months ago #

    Hey, mate, sorry for the late response, I solved the problem.It was in the main php file, the private function get_joomla_id_in_link($link) :

    // With URL rewriting
    elseif ( preg_match("#(.*)/(\d+)-(.*)#", $link, $matches) ) {
    $meta_key_value['meta_value'] = $matches[2];
    }
    So... my boss told me the problem was with the URL rewriting - the "-(.*)" part from the regular expression makes the internal link modifying process semi-sucessful, so it doesn't need the dash.When this part of the regular expression is removed it fixes up to 98 % of the internal links(so far in the test from 30 links, only one is not properly connected, which is good I guess).

    If anyone here is having the sam problem as I had - refer to this page, open the fg-joomla-to-wordpress.php file, go to the line :
    // With URL rewriting
    elseif ( preg_match("#(.*)/(\d+)-(.*)#", $link, $matches) ) { $meta_key_value['meta_value'] = $matches[2];
    }
    and delete the "-(.*)" part from the regular expression.It should look like this :
    // With URL rewriting
    elseif ( preg_match("#(.*)/(\d+)#", $link, $matches) ) {
    $meta_key_value['meta_value'] = $matches[2];
    }

  7. Kerfred
    Member
    Plugin Author

    Posted 6 months ago #

    Thanks.
    But before doing these modifications on the plugin, can you give me an example of a link that is not modified with the original code?
    Normally, the Joomla SEF URLs follow this pattern: /{joomla_article_id}-{joomla_article_name}.
    So, deleting -(.*) will match more links but will match also non internal links.

Reply

You must log in to post.

About this Plugin

About this Topic