Are you sure you need a redirect to a new URL which will be exposed to users, or are you looking for a rewrite to serve content from a script but using a "friendly" URL to access it?
There's more than ten thousand prior examples of such code in this forum. Please post your best effort code for discussion.
I am new to this, so I actually not sure what I want. All I want is, when the user enter
domain.com/<username>/<event>
I should be able to get the URL value using a PHP script page here
domain.com/show?username=<username>&id=<event>
Now whether this should be URL redirect or internal server interpretation, I am confused on this. You tell me what would be best for me?
All I can this is not about SEO. For me this is all about running the PHP script.
Thank you,
g1smd
4:43 pm on Sep 4, 2010 (gmt 0)
The linked tutorial explains it all. A redirect makes the user agent (that's your browser) ask for a NEW URL. A rewrite gets content from a non-default location inside the server and delivers it for the originally requested URL.
impact
1:20 am on Sep 5, 2010 (gmt 0)
Please correct me if I am wrong
event.example.com/<username>/<event> TO event.example.com/show?username=<username>&id=<event>
In addition to this, please some one tell me how do I add exception. For example. Directory such as "account" and "help" should not be redirected but any thing other that, should always be redirected.
It looks like you are copying, pasting, and guessing.... A method that is almost certainly doomed to failure. Please make note of the thread I cited above, and take advantage of the resources available in our Apache Forum Charter and Apache Forum Library (see links above on this page).
The first rewritecond is only needed if this .htaccess file executes when more than one hostname is requested -- that is, it's only needed if several domains and/or subdomains 'share' the filespace in which this code is located.