Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-18-2011, 12:16 PM   PM User | #1
vasuever
New to the CF scene

 
Join Date: Aug 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
vasuever is an unknown quantity at this point
Question how to redirect htaccess code?

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?
vasuever is offline   Reply With Quote
Old 08-18-2011, 08:21 PM   PM User | #2
samra1982
New to the CF scene

 
Join Date: Aug 2011
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
samra1982 is an unknown quantity at this point
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.
samra1982 is offline   Reply With Quote
Old 08-19-2011, 06:45 AM   PM User | #3
Cags
New Coder

 
Join Date: Jul 2011
Posts: 67
Thanks: 0
Thanked 13 Times in 13 Posts
Cags is an unknown quantity at this point
Quote:
Originally Posted by samra1982 View Post
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.
Cags is offline   Reply With Quote
Old 08-22-2011, 08:36 PM   PM User | #4
justjojostudios
New to the CF scene

 
Join Date: Aug 2011
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
justjojostudios is an unknown quantity at this point
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
justjojostudios is offline   Reply With Quote
Users who have thanked justjojostudios for this post:
samra1982 (08-29-2011)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:45 PM.


Advertisement
Log in to turn off these ads.