Need help rewriting URL's (Using htaccess) for PPC

trioreal

Regular Member
Joined
Jan 15, 2009
Messages
238
Reaction score
58
Hi,

I'm trying to rewrite dynamic URL's to virtual .html URLs but can' figure it out..

example:

Code:

Code:
http:///www.example.com/sub/index.html?keyword=var1 var2 var3

to

Code:

Code:
http:///www.example.com/sub/var1-var2-var3.html

There could be more than 3 variables or less...

any idea?
 
This should put you in the right direction: http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/
 
If you want a long term reference that you can use over and over for all sorts of rewrites, invest in a decent book. I constantly refer to "The Definitive Guide to Apache mod_rewrite" by Rich Bowen to make sure I get things right. It's paid for my investment many times over.

Also make sure you test your rewrites well - you can easily stuff it up and cause yourself a heap of drama and damage your SE position. Rewrites can be a PITA to debug, especially if you have a regualr expression error or a loop. Two tools that help are RegexBuddy (http://www.regexbuddy.com/) to check your regular expressions and Web Sniffer (http://web-sniffer.net/) to see what rewrite URL actually gets sent to the browser.
 
Code:
ReWriteRule ^sub/(.*)-(.*)-(.*).html$ sub/index.html?keyword=$1 $2 $3
This wont work because of the malformed url and I an not rly sure that the rewrite is correct, but it should give you an ideea.
 
I've got a url rewrite question. I've got a ton of outbound links on my site that would take forever to manually edit. I want to blank the referrer to these outbound links using the blanking server https://referer.us

How can I use .htaccess to prepend http://referer.us to all my outbound links so that all m referers are blanked?

Thanks.
 
I am not sure on how to do it via your .htaccess file, but I have a plug-in that allows you to add links to words (specified by you) automatically.

Not sure if this will help you, PM me if you want to know more.
 
Back
Top