You are here:  » jump.php links to seo friendly links

Support Forum



jump.php links to seo friendly links

Submitted by fstore on Sat, 2011-09-10 05:31 in

Greetings David

I was wondering if we can tweak .htaccess file, to make following changes to the jump.php generated links.

For Example

From:
http://www.example.com.au/shopping/jump.php?id=645483

To:
http://www.example.com.au/shopping/645483

Thanks

Submitted by support on Sat, 2011-09-10 09:36

Hi fstore,

Sure - add the following rule to your .htaccess

RewriteRule ^([0-9]*)$ jump.php?id=$1 [L]

And then in includes/tapestry.php, look for the following code around line 85:

return $config_baseHREF."jump.php?id=".$product["id"];

...and REPLACE with:

return $config_baseHREF.$product["id"];

However, bear in mind that I normally recommend excluding jump.php from robots.txt as you don't really want search engines go through your jump.php and recording clicks, so that may be something to bear in mind...

Cheers,
David.
--
PriceTapestry.com

Submitted by fstore on Sat, 2011-09-10 16:03

Hi David

I removed the below code from .htaccess. it fixed the issue and also at the same time I am getting the clean URL.
For example: http://www.example.com/shopping/360979"

RewriteRule ^([0-9]*)$ jump.php?id=$1 [L]

SO that mean only changes in includes/tapestry.php were required.
Is it OK, not to add the above rewriteRule?

Cheers

Submitted by support on Sat, 2011-09-10 17:41

Hi,

Sorry about that, the RewriteRule wasn't quite correct - I checked your site and whilst the links are correct clicking them returns 404 (as there is no longer any rule to handle them in .htaccess).

The correct rule in .htaccess should be:

RewriteRule ^([0-9]+)$ jump.php?id=$1 [L]

Whilst this will have a cleaner look on your site if you don't like seeing links to jump.php it will no longer be excluded by robots.txt, and as you want to use just a number on the end of /shopping/ I'm not actually sure that you can exclude it so I would actually consider using, for example:

/shopping/jump/360979

...in which case the .htaccess rule would be

RewriteRule ^jump/([0-9]+)$ jump.php?id=$1 [L]

...and the replacement in includes/tapestry.php

return $config_baseHREF."jump/".$product["id"];

Cheers,
David.
--
PriceTapestry.com

Submitted by fstore on Sun, 2011-09-11 16:07

Thanks for the correct rule.

I didn't quite understand the second part of your comment: because in robot.txt I am excluding robot's access to jump.php file. i am not sure what it has to do with URL being /sopping/360979 or shopping/jump/360979. May be I am missing something.

Whilst this will have a cleaner look on your site if you don't like seeing links to jump.php it will no longer be excluded by robots.txt, and as you want to use just a number on the end of /shopping/ I'm not actually sure that you can exclude

Submitted by support on Mon, 2011-09-12 09:06

Hi fstore,

Once you create a rewrite for something, as in this case where you are making a rewrite of /shopping/jump/1234 to jump.php?id=1234 external visitors and search engine crawlers no longer have any idea about jump.php - it doesn't exist as far as they are concerned so the entry for jump.php in robots.txt will no longer be relevant.

Instead, assuming that you still want to block the exit links if using jump as recommended (to avoid search engines triggering clicks) then you would need to modify the entry in robots.txt accordingly, for example

Disallow: /jump/

Cheers,
David.
--
PriceTapestry.com