![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Living inside your head.
Industry Role:
Join Date: Dec 2002
Location: In your AirBNB
Posts: 20,411
|
Anybody here know regex and redirect match?
Holy shit it's not a political thread...
Pretend we are working with something like this: domain.com/montana/milfs-in-bozeman.php domain.com/montana/bozeman-is-boring.php domain.com/montana/fuck-bozeman-it-sucks-here.php domain.com/montana/whatever-bozeman-random-shit.php And you want to redirect anything in the /montana/ folder that mentions bozeman to a new folder domain.com/montana/bozeman/index.php I dont need to match the filename in the new folder, I have plans for something different... just need to match the city and send it to the correct folder. Right now all the cities are just dumped in one folder... thousands of pages actually. Somebody have a htaccess code for this? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Jan 2003
Posts: 951
|
Not sure what you mean but I generate those types of pages and redirect using a cloaker
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Living inside your head.
Industry Role:
Join Date: Dec 2002
Location: In your AirBNB
Posts: 20,411
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Jan 2003
Posts: 951
|
Only way I know is to import your pages into wordpress and use a cloaker plugin. Then redirect off keywords/searches anywhere you want.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Living inside your head.
Industry Role:
Join Date: Dec 2002
Location: In your AirBNB
Posts: 20,411
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Pounding Googlebot
Industry Role:
Join Date: Aug 2002
Location: Canada
Posts: 34,451
|
It's been a while since doing htaccess redirects, but you should be able to do a conditional match with regexp to match #domain.com/(.*?)/(.*?)bozeman(.*?)#
WG
__________________
I play with Google. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Living inside your head.
Industry Role:
Join Date: Dec 2002
Location: In your AirBNB
Posts: 20,411
|
Quote:
I can figure it out but it's like missing three digits of a phone number ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
StraightBro
Industry Role:
Join Date: Aug 2003
Location: Monarch Beach, CA USA
Posts: 56,232
|
You sneaky sneaky little mynx you
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Just Doing My Own Thing
Industry Role:
Join Date: Jan 2011
Location: London, Spain, New Zealand, GFY - Not Croydon...
Posts: 25,034
|
Just the word 'regex' makes my head hurt - The guy that invented it must still laugh when he sees geeks tearing what little hair they have left out...
__________________
- Chaturbate Script - https://gfy.com/fucking-around-and-b...er-issues.html - Now supports White Labels |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Making PHP work
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,227
|
[The correct answer has been blocked because Blackmonsters is on your shit list.]
__________________
Make Money with Porn |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Hmm
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
|
There are many ways to achive that, one would be to place local .htaccess to /montana/ directory with the following lines:
Code:
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} ^.*(bozeman).*$ RewriteRule ^ /montana/bozeman/index.php [L,R=302,NE] </IfModule> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Living inside your head.
Industry Role:
Join Date: Dec 2002
Location: In your AirBNB
Posts: 20,411
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Living inside your head.
Industry Role:
Join Date: Dec 2002
Location: In your AirBNB
Posts: 20,411
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Living inside your head.
Industry Role:
Join Date: Dec 2002
Location: In your AirBNB
Posts: 20,411
|
I'm just deleting it and rebuilding it. Spent too much time on it already, and google will respider the whole thing in a couple of days. No big deal.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Hmm
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
|
Yup, could be, cause the url redirected to also contains the "bozeman" keyword.
So, you can add some condition before to ignore the url you are redirecting to for example: Code:
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} !^.*(\/montana\/bozeman\/index.php)$ RewriteCond %{REQUEST_URI} ^.*(bozeman).*$ RewriteRule ^ /montana/bozeman/index.php [L,R=302,NE] </IfModule> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 | |
Living inside your head.
Industry Role:
Join Date: Dec 2002
Location: In your AirBNB
Posts: 20,411
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Living inside your head.
Industry Role:
Join Date: Dec 2002
Location: In your AirBNB
Posts: 20,411
|
That worked great
![]() Thanks, Cyber Fucker! ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |