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
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 07-19-2006, 09:40 PM   #1
clickhappy
Confirmed User
 
Industry Role:
Join Date: Mar 2004
Posts: 4,027
ANy programmers here know how to do an if/else??

I just need something that says if /2/ appears in a url, then change it to /3/.
I want it to go to a different folder.
Anyone know how to do this with php, or javascript?
is that going to slow down the page a lot?

Last edited by clickhappy; 07-19-2006 at 09:41 PM..
clickhappy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 10:00 PM   #2
BigBen
Confirmed User
 
Join Date: Nov 2004
Location: scv
Posts: 2,299
May want to use mod_rewrite.
BigBen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 10:01 PM   #3
Sly
Let's do some business!
 
Sly's Avatar
 
Industry Role:
Join Date: Sep 2004
Location: Austin, TX
Posts: 31,291
I haven't done much programming in a long time and I wasn't the best, but I think for something like that you would be much better off using regular expressions, not if/else.
__________________
Vacares - Web Hosting, Domains, O365, Security & More - Paxum and BTC Accepted

Windows VPS now available.

Wanted: CCBill pay sites for sale
Sly is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 10:03 PM   #4
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Quote:
Originally Posted by BigBen
May want to use mod_rewrite.
__________________
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 07-19-2006, 10:06 PM   #5
Nookster
Confirmed IT Professional
 
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
Need to use mod_rewrite for that one.
Nookster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 10:19 PM   #6
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
<?php

$this = $PHP_SELF;
if (preg_match("/\/2\//", $this)) {
echo "folder found";
}
else {
echo "folder not found";
}
?>

if the folder name your looking for is 2 like

www.yoursite.com/nastylady/2/something.html
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 10:24 PM   #7
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
whoops i think i misunderstood your question actually. you want to rewrite all urls on the page or if the php itself is in a folder called /2/ ?
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 10:53 PM   #8
madawgz
8.8.8.8
 
madawgz's Avatar
 
Industry Role:
Join Date: Mar 2006
Location: Noordermarkt
Posts: 30,509
Quote:
Originally Posted by SmokeyTheBear
<?php

$this = $PHP_SELF;
if (preg_match("/\/2\//", $this)) {
echo "folder found";
}
else {
echo "folder not found";
}
?>

if the folder name your looking for is 2 like

www.yoursite.com/nastylady/2/something.html
something else to learn
__________________
TAEMDLRMSKRJIXMRLSMRJ.
madawgz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 11:07 PM   #9
clickhappy
Confirmed User
 
Industry Role:
Join Date: Mar 2004
Posts: 4,027
Quote:
Originally Posted by SmokeyTheBear
whoops i think i misunderstood your question actually. you want to rewrite all urls on the page or if the php itself is in a folder called /2/ ?
no
when the url says http://www.whatever.com/porn/2/
I want to rewerite it to say http://www.whatever.com/porn/3/ automatically because there are a ton of links
clickhappy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 11:19 PM   #10
adultseo
Confirmed User
 
Join Date: Jun 2005
Location: The Netherlands
Posts: 365

  • is the /porn/ directory a real directory?
  • is /porn/ the only directory in wich you need /2/ rewritten to /3/?
  • would you like to use Mod rewrite to simulate as if /2/ is /3/, so it will look to the browser as if you are on /2/ but you see /3/, or do you want to have a redirect in wich I would advice to use a 301 redirect so that the possibly indexed /2/ directory it's PR (SE value) is transfered to /3/

Let me know ;)

Best Regards,
Adult SEO
__________________
The key to get ranked one in Google is to provide the best.
adultseo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 11:40 PM   #11
BigBen
Confirmed User
 
Join Date: Nov 2004
Location: scv
Posts: 2,299
Drop this in your .htaccess in the /porn/ directory for a redirect...

RewriteEngine On
RewriteRule ^2/$ /porn/3/ [R]
BigBen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 11:49 PM   #12
adultseo
Confirmed User
 
Join Date: Jun 2005
Location: The Netherlands
Posts: 365
In that case better use:
Code:
RewriteEngine on
rewriterule ^2/$ http://www.domain.com/ [r=301,L]
rewriterule ^2/(.*)$ http://www.domain.com/$1 [r=301,L]
This is better for SEO in case your old /2/ directory has been indexed.
__________________
The key to get ranked one in Google is to provide the best.
adultseo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-19-2006, 11:55 PM   #13
Kimo
...
 
Join Date: Jan 2006
Location: Maryland ICQ:87038677
Posts: 11,542
php sucks inrl
__________________
...
Kimo 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



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.