1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need to use 301 redirect with wildcards to rename paths for Google Sitemaps

Discussion in 'Google Sitemaps' started by Trend Hunter, May 2, 2006.

  1. #1
    I see that my xml file (www.trendhunter.com/sitemap.xml) does not view properly in explorer because some of my category pages have the & symbol in them:

    e.g. http://www.trendhunter.com/cool-hunting/category/Technology-Trends-&-Gadgets/
    SEMrush
    I want to fix this, but it means I have to change the name of about 20 category pages which have a -&- in the middle of them, and replace that with a -and-

    Is possible to put something like this in the .htaccess (ie. use wildcards in a redirect)? (this would be IDEAL)

    Redirect 301 *-&-* *-and-*

    OR, is there a way to do the following in PHP:

    {if URL segment_4 CONTAINS “-&-"}
    <?php
    global $FNS;
    $FNS->redirect('http://www.trendhunter.com/cool-hunting/category/{exp:replace find='-&-' replace='-and-'}{URL_segment_4}{/exp:replace}');
    ?>
    {/if}

    The ‘catch’ with the above, is that I don’t know how to make the IF statement do a ‘CONTAINS’ query, and I don’t know how to make the replace function replace a & symbol… Either way, the REDIRECT with wildcards is more preferable....
     
    Trend Hunter, May 2, 2006 IP
    SEMrush