: Redirecting some parts of a url ok let me try once again this link [www.mgdezigns.com/cards/festive_silver_purple_ornament_holiday_cards_postcard-239887577090743570.html] needs to be redirected to this[www.zazzle.com/festive_silver_purpl
ok let me try once again this link [www.mgdezigns.com/cards/festive_silver_purple_ornament_holiday_cards_postcard-239887577090743570.html]
needs to be redirected to this[www.zazzle.com/festive_silver_purple_ornament_holiday_cards_postcard-239887577090743570] OR [www.zazzle.com/239887577090743570] (both links are same and work, whichever is simpler to code)
because what I have pinned to pinterest is this
[www.mgdezigns.com/cards/festive_silver_purple_ornament_holiday_cards_postcard-239887577090743570.html]
and it shows empty page so what i want is that the people who click on this link [www.mgdezigns.com/cards/festive_silver_purple_ornament_holiday_cards_postcard-239887577090743570.html]
from pinned images at pinterest.com actually get redirected to [www.zazzle.com/festive_silver_purple_ornament_holiday_cards_postcard-239887577090743570 ] OR [www.zazzle.com/239887577090743570] (both links are same and work, whichever is simpler to code)
is something like this possible?
Thank You so much!
You will be a life saver!
More posts by @Shanna517
2 Comments
Sorted by latest first Latest Oldest Best
If you want to remove the .html on URLs that otherwise would end in a number, you could use this:
RedirectMatch permanent /(.*[0-9]).html$ /
Older versions of Apache (before 2.2.6) don't support relative URLs and you would have to use the full URL:
RedirectMatch permanent /(.*[0-9]).html$ www.zazzle.com/
You could do something like the following in .htaccess to match all the "cards", grabing just the number from the URL:
RewriteEngine On
RewriteRule ^cards/[a-z_]+-([d]{10,}).html$ www.zazzle.com/ [R=301,L]
To add more categories you could be explicit...
RewriteRule ^(?:cards|invitations|weddings)/[a-z_]+-([d]{10,}).html$ www.zazzle.com/ [R=301,L]
Or, be generic, to match anything in the first path segment:
RewriteRule ^[a-z]+/[a-z_]+-([d]{10,}).html$ www.zazzle.com/ [R=301,L]
In fact, you could just match any URL that ends in a hyphen followed by a long number...?
RewriteRule -([d]{10,}).html$ www.zazzle.com/ [R=301,L]
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.