![]() |
|
| Domain Name Sales | Domain Software | Calculate UK Domain Drop Dates | Domain Registration | NameDrive | Domain Parking | Subscribe to our Domains For Sale newsletter |
| | ||||||
| Home | Register | Rules | Membership Upgrade | Domains For Sale | Domain Name Escrow | Mark Forums Read | Domain Classified | Chat Room |
| Website Design Discuss web design |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #11 (permalink) |
![]() |
My RegEx is limited too, the one member I introduced to the forum who was very very good at regex was chased away and stoned like a martyre and refuses to come on the forum now. The multiple rules allow you to determin which is it. RewriteEngine on RewriteRule ^search/(.*)/town/(.*)/(.*) sample.php?function=search&type=$1&town=$2&page=$3 RewriteRule ^search/(.*)/county/(.*)/(.*) sample.php?function=search&type=$1&county=$2&page= $3 Then in PHP test page and set to 0/1 if not set. Write a rule for each one, it the 'easiest' option, I expect more advanced regex as possible but they are beyond my basic understanding of it. Something like that may work.
__________________ Browse: |
| |
| | #12 (permalink) |
![]() |
time to "fiddle" I think I used to use a number of complex regex's in Unix print filters piping via sed & awk about 15-20 years ago so we could share printers on the mini's with the PC's, but I'm quite rusty these days
__________________ Alex Monaghan - Drop Catch & Drop Lists - PM for details Online Accounting|Pine Furniture|Barbie |
| |
| | #13 (permalink) |
![]() |
Why not use the simple way like: ErrorDocument 404 /index.php and then do the rest of coding in php? In this case variable is passed, and you can easily add extra redirections if needed. This is the way some url shortening services work, when giving <domain>/<short> redirection.
__________________ Car Stereo Systems <> Insulation Materials <> Men's White Jeans <> Discount Laptops ...and many more for sale. Make me an offer ;) |
| |
| | #14 (permalink) |
![]() |
I'm on my not so smart phone so this may come out as more crap than usual. If you rely on your error handler to do this, you wouldn't realistically and reliably be able to determine what was an error, what was a legit request and what was someone trying to inject. Aside from the best practice and good form issues. You would need php to parse and split the current path to convert it into chunks then push the pieces into variables then operate on them to determine search or show etc, then produce your page. I think i got that right its hard to tell when you can only see 50 to 70 characters at a time A busy site would eat a shared resource server alive first in processor time then in memory. Least thats if i understood your meaning.
__________________ Browse: |
| |
| | #15 (permalink) | |
![]() | Quote:
P.S. If you need just 1-2 redirects, you can even "hardcode" them into index.php so no database is needed.
__________________ Car Stereo Systems <> Insulation Materials <> Men's White Jeans <> Discount Laptops ...and many more for sale. Make me an offer ;) Last edited by expertc; 17-11-2009 at 08:11:14 PM. Reason: Other Option added | |
| |
| | #16 (permalink) |
![]() |
I can't see how you could not parse it when the function would accept search, view, show or whatever else so you would need to split out the function, the search function then accepts either county or town, maybe even city so you'd need to work that out. On top of this you have an optional variable of page to check. I guess you could do like url shortening scripts do, the last one i worked on basically took the first x characters after the / ran a query then returned based on those characters but with 1000s of towns/city/counties it would call ache. I think i'm misunderstanding what your idea is. I'm sure if you've done it, it works but i can't visualise the code or methods and not near an interpreter to try it. My suggestion is half a dozen rewrite rules that matches each distinct set. 1 for county, 1 for city, 1 for town, 1 for view etc, with 1 test and set for page. I'm sure you could use the or operator in regex to town||city||county etc to reduce the lines too.
__________________ Browse: |
| |
| | #17 (permalink) | |
![]() | Quote:
function line_redirect($line) { global $dbcheck; $qry = "SELECT * FROM $dbcheck WHERE id = '$line';"; $out = mysql_query($qry) or die ("Error: Query failed"); $rows = mysql_num_rows($out); if (($rows != 0) && (mysql_result($out, 0, "url") != "")) { <put whatever you need here, like redirects> } <real 404 here> Maybe we are talking about different redirect types?
__________________ Car Stereo Systems <> Insulation Materials <> Men's White Jeans <> Discount Laptops ...and many more for sale. Make me an offer ;) Last edited by expertc; 17-11-2009 at 09:35:53 PM. Reason: typo | |
| |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Domain Name Community | Replies | Last Post |
| .htaccess help | SecNam | Website Design | 1 | 07-09-2009 01:42:31 AM |
| URL Rewrite | GeoMal | Services Wanted | 2 | 06-02-2009 09:20:25 AM |
| Mod Rewrite assistance | grantw | Search Engine Optimisation | 5 | 23-12-2007 10:08:43 AM |
| mod rewrite anyone? | SecNam | Search Engine Optimisation | 6 | 03-08-2007 01:35:03 PM |
| catch all with .htaccess | stevie | General Board | 4 | 05-10-2006 10:19:43 PM |