![]() |
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? |
Not sure what you mean but I generate those types of pages and redirect using a cloaker
|
Quote:
|
Only way I know is to import your pages into wordpress and use a cloaker plugin. Then redirect off keywords/searches anywhere you want.
|
Quote:
OMG no... |
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 |
Quote:
I can figure it out but it's like missing three digits of a phone number :) |
You sneaky sneaky little mynx you
|
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...
|
[The correct answer has been blocked because Blackmonsters is on your shit list.]
|
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> |
Quote:
|
Quote:
|
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.
|
Quote:
So, you can add some condition before to ignore the url you are redirecting to for example: Code:
<IfModule mod_rewrite.c> |
Quote:
|
That worked great :)
Thanks, Cyber Fucker! :thumbsup |
All times are GMT -7. The time now is 12:26 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc