Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-27-2011, 05:39 PM   #1
Persius
Tap into MOBILE!
 
Industry Role:
Join Date: Jul 2003
Location: Hollywood
Posts: 11,779
I have a quick question for programmers or server admins

Let say I want to make a rule in htaccess that when a user types mydomain.com/xxxxxxx
it will redirect them to another site otherdomain.com/folder/xxxxxxx/folder...

so basically its taking what they put after the url and inserting it in another url that it will redirect them to.

what's the best way to go about this? thanks in advance

Last edited by Persius; 05-27-2011 at 05:41 PM..
Persius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 05:45 PM   #2
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Mod Rewrite FTW

icq: 33375924 I'll hook it up for you for a few bucks
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 05:52 PM   #3
CYF
Coupon Guru
 
CYF's Avatar
 
Industry Role:
Join Date: Mar 2009
Location: Minneapolis
Posts: 10,973
Redirect /folder http://www.example.com/newfolder
__________________
Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

CYF is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 05:54 PM   #4
Persius
Tap into MOBILE!
 
Industry Role:
Join Date: Jul 2003
Location: Hollywood
Posts: 11,779
to clarify

the xxxxxxx = different each time (username)
Persius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 05:55 PM   #5
Juicy D. Links
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: N.Y. -Long Island --
Posts: 122,992
kuniiiiiiiiiiiiiiiiiiiiiii
Juicy D. Links is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 06:23 PM   #6
onwebcam
Fake Nick 1.0
 
onwebcam's Avatar
 
Industry Role:
Join Date: Oct 2005
Location: Rent free, your head
Posts: 27,652
301 redirect
http://www.webconfs.com/how-to-redirect-a-webpage.php
__________________
PLEASE WAIT WHILE BIDEN ADMIN UNINSTALLS ITSELF.....
██████████████████▒ 99.5% complete.
onwebcam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 06:35 PM   #7
VIPimp
Marina WILL have my babies!
 
Industry Role:
Join Date: May 2003
Posts: 9,234
He's not trying to do a regular redirect... he wants the the id in the url to carry over within the url it will be redirected to.
VIPimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 06:43 PM   #8
CYF
Coupon Guru
 
CYF's Avatar
 
Industry Role:
Join Date: Mar 2009
Location: Minneapolis
Posts: 10,973
Quote:
Originally Posted by Persius View Post
to clarify

the xxxxxxx = different each time (username)
you'll need some PHP for that.
__________________
Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

CYF is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 07:15 PM   #9
react
Confirmed User
 
Industry Role:
Join Date: Sep 2003
Location: NZ
Posts: 673
Can be done with mod_rewrite exclusively.
__________________
--
react
react is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 08:18 PM   #10
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,214
maybe something like this?

Code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^([a-z0-9]+)$ http://otherdomain.com/folder/$1/folder [NC,R=301,L]
(removes www from domain, not really needed)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 08:50 PM   #11
VIPimp
Marina WILL have my babies!
 
Industry Role:
Join Date: May 2003
Posts: 9,234
Quote:
Originally Posted by fris View Post
maybe something like this?

Code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC]
RewriteRule ^([a-z0-9]+)$ http://otherdomain.com/folder/$1/folder [NC,R=301,L]
(removes www from domain, not really needed)
Thank you Fris, EXACTLY what we were looking for... BUT do you know how we can make it work if the variable also has dashes in it.
This does not work if its something like domain.com/xx-xxxx-xxxxx ...we need it to work in both situations.
VIPimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 09:08 PM   #12
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Code:
RedirectMatch 301 ^/(.*)$ http://static.askapache.com/$1
http://www.google.com/cse/home?cx=00...%3Akk7rwc2gx0i

Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 09:28 PM   #13
VIPimp
Marina WILL have my babies!
 
Industry Role:
Join Date: May 2003
Posts: 9,234
Quote:
Originally Posted by Barry-xlovecam View Post
Code:
RedirectMatch 301 ^/(.*)$ http://static.askapache.com/$1
thanks that worked too but it also redirects the typeins to the domain that dont have anything after .com/

I got Fris's code to work by adding a - after the 9 in the rewrite rule... RewriteRule ^([a-z0-9-]+)


do you know what line I should put if I want the regular typeins redirected to a whole other site such as just www.yahoo.com ?
VIPimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2011, 10:55 PM   #14
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Quote:
Originally Posted by VIPimp View Post
thanks that worked too but it also redirects the typeins to the domain that dont have anything after .com/

I got Fris's code to work by adding a - after the 9 in the rewrite rule... RewriteRule ^([a-z0-9-]+)


do you know what line I should put if I want the regular typeins redirected to a whole other site such as just www.yahoo.com ?
Code:
RedirectMatch 301 ^/*$ http://www.yahoo.com/
RedirectMatch 301 ^/(.*)$ http://static.askapache.com/$1
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-28-2011, 03:36 AM   #15
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,214
Quote:
Originally Posted by VIPimp View Post
thanks that worked too but it also redirects the typeins to the domain that dont have anything after .com/

I got Fris's code to work by adding a - after the 9 in the rewrite rule... RewriteRule ^([a-z0-9-]+)


do you know what line I should put if I want the regular typeins redirected to a whole other site such as just www.yahoo.com ?
how are you detecting typins?
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.