![]() |
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? |
May want to use mod_rewrite.
|
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.
|
Quote:
|
Need to use mod_rewrite for that one.
|
<?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 |
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/ ?
|
Quote:
|
Quote:
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 |
Let me know ;) Best Regards, Adult SEO |
Drop this in your .htaccess in the /porn/ directory for a redirect...
RewriteEngine On RewriteRule ^2/$ /porn/3/ [R] |
In that case better use:
Code:
RewriteEngine on |
php sucks inrl
|
All times are GMT -7. The time now is 10:49 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc