...

View Full Version : HTACCESS rewrite



sitNsmile
09-03-2010, 11:19 PM
Okay, I believe it can be done here, I just not sure how to do a sub domain,

I want the end user to see

domain.com/ads/

but I want the script to be on

ads.domain.com

This possible?

sitNsmile
09-04-2010, 01:24 AM
Guess it seems no one understands how to do this type of modification.

sitNsmile
09-07-2010, 02:32 AM
Thought I'd share how this can be done.



RewriteRule ^ads/(.*)$ http://ads.domain.com/$1 [P,NC]


Which after testing, decided it wasn't going to work with how I have the program setup, but I'll resolve the post with the correct code.

Took a lot of modification to test this, but it worked pretty well. Its important that the P is there. Requires modifications on the server to support it

Fou-Lu
09-07-2010, 04:35 AM
Why is this in the PHP forum? Moving from PHP to Apache Configurations forum.

Sorry, you said this did work right? It should be fine, the P flag will push it through the mod_proxy to switch it to a different host (it also implies that this is the last rule as well). I've seen this behaviour used for alternative media servers such as images and whatnots, but I've never before seen it used for direct redirection to a url. The limitation of this is that it now becomes completely dependent on Apache itself.

sitNsmile
09-07-2010, 09:18 AM
Why is this in the PHP forum? Moving from PHP to Apache Configurations forum.

Sorry, you said this did work right? It should be fine, the P flag will push it through the mod_proxy to switch it to a different host (it also implies that this is the last rule as well). I've seen this behaviour used for alternative media servers such as images and whatnots, but I've never before seen it used for direct redirection to a url. The limitation of this is that it now becomes completely dependent on Apache itself.


Thanks Fou-Lu, yes it does work correct, but its not working out because its producing duplicate results. and I didnt know their was an Apache Config forum. ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum