Forum Moderators: phranque

Message Too Old, No Replies

Apache rewrite question

         

pokerguy

4:16 pm on Jun 1, 2009 (gmt 0)

10+ Year Member



I'm interested in doing profiles for a site and need to redirect to the script to generate them using htaccess.

Example: my.foo.com/1234 redirects to www.foo.com/profiles/?profile_id=1234

Any help is greatly appreciated.

pokerguy

4:50 pm on Jun 1, 2009 (gmt 0)

10+ Year Member



I believe I have it working with following:

RewriteEngine On
RewriteBase /

RewriteRule ^([0-9]+)$ [foo.com...] [R]

jdMorgan

5:20 pm on Jun 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your code, however, exposes the dynamic URL to users and to search engines. Is that what you want?

There is also the potential there for a redirection loop, except that you're apparently redirecting from the "my" subdomain to the "foo" main domain.

Jim

g1smd

5:24 pm on Jun 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Instead of a redirect (currently you have a 302 redirect there), maybe you need a rewrite instead?