Problem with index.php/archives and index.php/category

We know that WordPress is most famous blog in the world, and the default link for WordPress is using /archives and /category.

But this make problems to those sites that are not using WordPress, like my site is using Phpwind.

Most of the search engine in the world will search for
example.com/archives/…
example.com/category/…

sometimes search for
example.com/index.php/archives/…
example.com/index.php/category/…


Many big site will use cache to store the sites that requested by user, and search engine too. So, something wrote appear to my Phpwind site.

It appear
http://forums.perak.org/cn/index.php/archives/images/m/simple/simple/attachment/mini/ae64b982c3.jpg
Sometimes appear
http://forums.perak.org/cn/index.php/category/…

Here is the temporarily solutions for Phpwind, from version 7.3.2 to version 8. If you enable cache.

Edit the file
global.php

put in the code on line 2, after the < ?

$block_uri[0] = 'archives';
$block_uri[1] = 'category';
foreach ($block_uri as $uri) {
if (strpos($_SERVER['REQUEST_URI'], $uri)) {
header('Location: http://forums.perak.org/cn/');
exit;
}
}

Now, all the request to
http://forums.perak.org/cn/index.php/archives/…
http://forums.perak.org/cn/index.php/category/…

Will redirect to http://forums.perak.org/cn/
So, now you just delete all the cache, clean up, then regenerate the cache, all the wrong path won’t be appear anymore.

Update (2010/09/12)

I modified into this to run better.

<?php

$block_uri[0] = 'index.php/';

foreach ($block_uri as $uri) {

if (strpos($_SERVER['REQUEST_URI'], $uri)) {

header('Location: http://forums.perak.org/cn/');

exit;

}

}



You may add to your index.php.

But I added in global.php


Tags: , , , , ,

Translate

Buy me a Caffè Latte

Thank you for the Caffè Latte

2013/02/15 saw art
2013/01/25 Parul Patel
2012/11/20 Barbara Nicholas $10
2012/10/08 Amy Stockman $5
2012/07/15 siewho chang $ 50
2012/06/08 Susan Hampton $10
2012/05/11 Chris Grima $10