
Originally Posted by
stoned
;1595147
i'm trying to add a mod rewrite on wordpress for a shareasale link as an
seo friendly link
sample url
Code:
http://www.shareasale.com/m-pr.cfm?merchantID=12345&userID=54321&productID=987654321
how do i go about it, i'm a complete n00b to htacess
you looking for something like this?
Code:
redirect 301 /seo-friendly-url http://www.shareasale.com/m-pr.cfm?merchantID=12345&userID=54321&productID=987654321
---------- Post added at 11:54 PM ---------- Previous post was at 11:24 PM ----------
Just a note to the above --
I assume you are basically trying to achieve masking your affiliate url so the user doesn't see some long ugly affiliate link but instead sees a nice friendly url.
You'll be aware that wp has it's own custom permalink structure, which just basically rewrites the ugly wp urls into nice seo friendly ones, and I assume you are using that feature. If you are not using that feature then goto settings > permalinks
then check 'custom structure'.
then insert this code:
Code:
/%category%/%postname%/
then hit savechanges
In your wp admin create a dummy page for your affiliate link page - can be anything really, just give the page the seo-friendly name that you want to achieve.
then save the page.
Then add the 301 code I gave you above to your htaccess file and make sure to change appropriate parts of it.
Also, if you use hierarchy or category structure then make sure to include the structure for your seo friendly url in the htaccess file. The code in my first post assumes no hierarchy or category structure, the link below assumes there is such a structure:
Code:
redirect 301 /uncategorised/seo-friendly-url/ http://www.shareasale.com/m-pr.cfm?merchantID=12345&userID=54321&productID=987654321
remember to have a '/' at the beginning and end of your seo friendly url structure and do not include your domain name in the seo friendly link - ie don't do this:
Code:
redirect 301 http://yourblogsite/seo-friendly-url/ http://affiliateurl
Bookmarks