Forum Moderators: phranque

Message Too Old, No Replies

Rule to append a directory

         

SwissMerlin

12:06 am on Nov 19, 2003 (gmt 0)

10+ Year Member



Hi again,

Again, i have an problem with the URL generated by a CMS.

Normaly a user enter a simple domain name like www.mydomain.ch

a rule should to this: If no parameter was entered, add a parameter. eg. www.mydomain.ch will be www.mydomain.ch?<parameter> or in the future www.mydomain.ch/<parameter>

Right now i made a solution with ColdFusion based redirect.
So, I heard that search engines doesn't like redirects 301's.

I'm sure, that mod_rewrite can handle this without a redirect-thing.

Any idea?

Thank you

jdMorgan

9:52 pm on Nov 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> a rule should to this: If no parameter was entered, add a parameter. eg. www.mydomain.ch will be www.mydomain.ch?<parameter> or in the future www.mydomain.ch/<parameter>

In httpd.conf:


RewriteCond %{QUERY_STRING} ^$
RewriteRule [b]^/$[/b] /?parameter [L]

In .htaccess:


RewriteCond %{QUERY_STRING} ^$
RewriteRule [b]^$[/b] /?parameter [L]

or, you can change the '?' to a '/'

Jim