Forum Moderators: coopster
My question is:
when user request a url like:
wwWebmasterWorldeb.com/keyword
I redirect his request to my real html file
wwWebmasterWorldeb.com/keyword/keyword1.htm,
But I wish the address bar is still showing his url request. in another world, keep short url,
so easy to remember.
anyway, any guru know an answer to this?
thanks so much!
[edited by: jatar_k at 2:54 pm (utc) on June 18, 2005]
[edit reason] no urls thanks [/edit]
in general the phenomena you describe is possible (especially with IE) and if you don't like that, then use a permanent redirect (301) by adding an additional header
php:
> header("Status: 301 Moved Permanently",true,301);
apache:
> Redirect 301 /keyword h**p://example.com/keyword/keyword1.htm
or
> Redirect permanent /keyword h**p://example.com/keyword/keyword1.htm
this should do the trick. by using the status header in php you avoid specifieing the http version (1.0 or 1.1). but keep in mind that this status code (301) tells the client that wwWebmasterWorldeb.com/keyword has moved to
wwWebmasterWorldeb.com/keyword/keyword1.htm permanently. i.e. robots will index the .htm in the future, not /keyword, bookmark collections might automaticaly update their bookmarks etc. .
edit: (for completition)
with mod_rewrite (as mentioned by RonPK), you can use the R or redirect flag with its additional parameter (=code) on the RewriteRule:
> RewriteRule ^/keyword$ h**p:/example.com/keyword/keyword1.htm [R=301]