Current location: Hot Scripts Forums » Other Discussions » Web Servers » htaccess and problems passing variables in the URL.


htaccess and problems passing variables in the URL.

Reply
  #1 (permalink)  
Old 12-23-06, 09:24 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
htaccess and problems passing variables in the URL.

Hi,


I have following htaccess file, and I'm getting a 404 error when I try to pass variables through the URL like this.

url.com/search/?sort=hits

While

url.com/search/

works. I tried adding ?%{QUERY_STRING} behind browse.php, but it didn't work.

Any ideas?

Code:
# DO NOT CHANGE THE FOLLOWING LINES
# status: 1
# pattern_category: {$cat_path}/more{$page}.html
# pattern_detail: detail/{$link_id}/{$link_title}.html

Options -MultiViews
RewriteEngine On

RewriteRule ^detail/(.*)/(.*)\.html detail.php?linkid=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^.* browse.php
Reply With Quote
  #2 (permalink)  
Old 01-07-07, 05:31 AM
Wolf1994 Wolf1994 is offline
Wannabe Coder
 
Join Date: Sep 2005
Location: Russia
Posts: 117
Thanks: 0
Thanked 0 Times in 0 Posts
You may use:

Code:
RewriteRule ^(.*)$ browse.php [QSA]
and $_SERVER ['REQUEST_URI'] - in PHP to catch all requsts to browse.php.

Or you may place in directory "search" index.php that will handle all these requests.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I am having htaccess, gd2, and header problems, please help. bliss PHP 4 12-11-06 10:13 PM
Permanent 301 Redirect to new Domain's URL giving me problems in .htaccess cebuy HTML/XHTML/XML 1 03-10-06 10:34 PM


All times are GMT -5. The time now is 01:25 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.