Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 07-15-2009, 03:36 PM
Red Blaze's Avatar
Red Blaze Red Blaze is offline
 
Join Date: Jan 2003
Location: Texas
Posts: 493
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default htaccess problem

I only know so much about htaccess, and my researching isn't really helping me get closer to the finish line. I'm having an issue and I'm very confused about its behavior.

Take a look at this htaccess code I have set up:
Notice, I added comments that pin point which rules are acting odd. Total of 3 lines, but they're all similar.
Code:
Options +FollowSymlinks
RewriteEngine on

RewriteRule ^Home$ /index.php [L]
RewriteRule ^Search$ /search.php [L]

#Searching through Category
RewriteRule ^Search/Category/(.*)$ /search.php?act=dosearch&jobtype=$1&boolean=any&date=all&exempt=all&perpage=5&country=US&searchType=category&searchType=category [L]
#This is one of the rules that are acting odd
RewriteRule ^Search/Category/(.*)/([0-9]+)-([0-9]+)$ /search.php?act=dosearch&jobtype=$1&boolean=any&date=all&exempt=all&perpage=$2&start=$3&country=US&searchType=category [L]

#Searching through location
RewriteRule ^Search/City/(.*)/(.*)$ /search.php?act=dosearch&jobtype=all&boolean=any&date=all&exempt=all&perpage=5&country=US&location=$1|$2&searchType=location [L]
#This is one of the rules that are acting odd
RewriteRule ^Search/City/([^/]+)/([^/]+)/([0-9]+)-([0-9]+)$ /search.php?act=dosearch&jobtype=all&boolean=any&date=all&exempt=all&country=US&location=$1|$2&perpage=$3&start=$4&searchType=location [L]

#Searching through company
RewriteRule ^Search/Company/([0-9]+)/(.*)$ /search.php?act=dosearch&jobtype=all&boolean=any&date=all&exempt=all&perpage=5&country=US&companyId=$1&companyName=$2&searchType=company [L]
#This is one of the rules that are acting odd
RewriteRule ^Search/Company/([0-9]+)/([^/]+)/([0-9]+)-([0-9]+)$ /search.php?act=dosearch&jobtype=all&boolean=any&date=all&exempt=all&perpage=$3&start=$4&country=US&companyId=$1&companyName=$2&searchType=company [L]

RewriteRule ^Job/(.*)$ /job.php?jid=$1 [L]
The problems lie when searching through location, category and company, but when trying to look at the 2nd page of the results. Here's the page(s) I'm working on that's using that part of the htaccess rules.

http://gagajobs.astralaxiom.net/Sear...y/Harlingen/TX

However, when trying to see the second page of the results:
ex: http://gagajobs.astralaxiom.net/Sear...rlingen/TX/5-5

You can see the array of requests when viewing those pages.

It's parameters are acting strangely. $1 should be Harlingen, $2 should be TX, $3 should be 5 and $4 should be 5. Unless I did something wrong in the code, which is exactly what I'm looking for in my researching... but the tutrials I've found and examples I've run into do not explain anything about using more than 2 parameters. Help and advice would greatly be appreciated.

------------------------

I'm still researching while I wait for some help, and I've tried so many other formats, such as:

RewriteRule ^Search/Company/([^/\.]+)/([^/\.]+)/([^/\.]+)-([^/\.]+)$
RewriteRule ^Search/Company/([0-9]+)/([^/\.]+)/([0-9]+)-([0-9]+)$
RewriteRule ^Search/Company/([0-9]+)/([^/.]+)/([0-9]+)-([0-9]+)$

But they all behave the same way... the results end the same. So confused. x.x

---------------------------

I found the problem... Like Conan from Case Closed says... "I can't believe I didn't see it before." The problem was "(.*)". I noticed that after clicking "Next x Results", the URL kept adding "5-5/5-5/5-5" and it was still the first page. So I changed all (.*) to a more specific... parameter? It's working like a charm, now.

If anyone took the time to look into it, thank you.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.15067 seconds
  • Memory Usage 2,154KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete