in reply to Re^2: .Htaccess rewrites, Mod_Rewrite Help
in thread .Htaccess rewrites, Mod_Rewrite Help
Try something like this:
RewriteEngine ON RewriteRule ^(.*)/?$ /cgi-bin/profile.cgi?$1 [L,QSA]
Explaination:
It's important to anchor the thing your trying to match, so use "^" to indicate the start and "$" to indicate the end. Since a URL may or may not end with a final "/", you need to use "/?" in the regex to indicate "optional trailing slash". The "L, QSA" means treat this as the LAST (that's the L part) rule. If your .htaccess file has rules after this one, they will be ignored - that's normally what you want, but you have to be careful. Sometimes you DO want multiple rules to be applied. The "QSA" means "append query string" - so any args get passed along to the new URL, rather than chopped off.
|
|---|