...

View Full Version : how to redirect htaccess code?



vasuever
08-18-2011, 01:16 PM
HI Everybody,

My php pages are strored in www.something.com/httpdocs/vasu folder.
so that we should be enter web home page like this, http://www.somthing.com/vasu but idont want to enter fullpath of webfolder www.something.com/httpdocs/vasu just simply enter like this: http://www.somthing.com.

i have written like this:

ReWritten EngineOn
ReWriteCond %{QUERY_STRING} ^(vasu)
RewriteRule ^\vasu$ http://something.com

what is wrong in my code?

samra1982
08-18-2011, 09:21 PM
Thanks for asking this question vasu.

I am also trying to do the same thing for two of my domains and need the solution desperately.

May be some genius will help us.

Cags
08-19-2011, 07:45 AM
Thanks for asking this question vasu.

I am also trying to do the same thing for two of my domains and need the solution desperately.

May be some genius will help us.
Coincidence much? Anyway, it sounds like ideally what you are attempting wouldn't be done with mod_rewrite, by the sounds of it, your DocumentRoot directive for apache needs changing.

justjojostudios
08-22-2011, 09:36 PM
rewritecond %{http_host} ^site.com [nc]
rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc]

This is how you redirect a site. Hope this helps



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum