Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- PHP and mod rewrite


arturito - 11:38 am on Oct 5, 2009 (gmt 0)


Sorry I meant your suggestion didn't work.

I'm echoing $_GET['s'] well I'm echoing $_GET['query'] as 's' is being rewritten to 'query'.

I also think that I don't need forward slash before search.php since my htaccess defines RewriteBase.

All other rules are working fine.

This is my htaccess:


RewriteEngine On
RewriteBase /

RewriteRule ^article/a([0-9]+)//?$ article.php?id=$1 [L]

RewriteRule ^profile/p([0-9]+)//?$ p.php?id=$1 [L]

RewriteRule ^autosearch//?$ quicksearch.php?$ [L]

RewriteCond %{QUERY_STRING} &?s=([^&]+)
RewriteRule ^search/([^/]+)$ search.php?query=%1 [L]

RewriteCond %{QUERY_STRING} &?s=([^&]+)
RewriteRule ^search/([0-9])/([^/]+)$ search.php?query=%1&pageno=$1 [L]

RewriteCond %{QUERY_STRING} &?s=([^&]+)
RewriteRule ^search/([0-9])/(dateŠazŠza)/([^/]+)$ search.php?query=%1&pageno=$1&sort_order=$2 [L]

ErrorDocument 404 [mydomain.com...]

changing it to


#1
RewriteCond %{QUERY_STRING} &?s=([^&]+)
RewriteRule ^search/([^/]+)/$ /search.php?query=%1 [L]

#2
RewriteCond %{QUERY_STRING} &?s=([^&]+)
RewriteRule ^search/([0-9])/([^/]+)/$ /search.php?query=%1&pageno=$1 [L]

#3
RewriteCond %{QUERY_STRING} &?s=([^&]+)
RewriteRule ^search/([0-9])/(dateŠazŠza)/([^/]+)/$ /search.php?query=%1&pageno=$1&sort_order=$2 [L]

didn't help either. In both cases as I enter urls:

[mydomain.com...] #I get my error.php

[mydomain.com...] # echo $_GET['query'] returns 'john', $_GET['pageno'] returns nothing

[mydomain.com...] # echo $_GET['query'] returns 'john', $_GET['sort_order'] and $_GET['pageno'] returns nothing

:(


Thread source:: http://www.webmasterworld.com/apache/3999881.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com