Advertisement

07.23.2008 at 05:40PM PDT, ID: 23590683
[x]
Attachment Details

Mod_Rewrite Help

Asked by derek2277 in Apache Web Server, PHP and Databases, Web Servers

Tags: Apache, Mod_rewrite

I have a search engine and I am attempting to rewrite the queries.  Here is what I have so far in my .htaccess:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
 
RewriteCond %{REQUEST_URI} /xanga/search.php$
RewriteCond %{QUERY_STRING} ^query=((.*)+)&search=1$
RewriteRule ^(.*)$ /xanga/keywords-%1? [R=301,L]
 
RewriteRule ^keywords-(.*)$ /xanga/search.php?query=$1&search=1&a=1 [L]

***This works fine and displays the url correctly:

ex. http://www.mysite.com/xanga/keywords-myquery***

I am running into a problem when I try to send the user to the next page of results.  Apache is not redirecting the url at all:

RewriteCond %{REQUEST_URI} /xanga/search.php$
RewriteCond %{QUERY_STRING} ^query=((.*)+)&search=1&start=([0-9]+)$
RewriteRule ^(.*)/(.*)$ /xanga/keywords-%1/%2? [R=301,L]

RewriteRule ^keywords-(.*)/(.*)$ /xanga/search.php?query=$1&search=1start=$2$a=1 [L]

</IfModule>

I would like to add that if I manually alter the url in the address bar it attempts to search for the entered string: ex. http://www.mysite.com/xanga/keywords-myquery/2 will search the database for "myquery/2"

Anyone know how to fix this?  Please let me know if I need to give more info.Start Free Trial
[+][-]07.23.2008 at 06:16PM PDT, ID: 22075448

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 11:19PM PDT, ID: 22076461

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 11:21PM PDT, ID: 22076469

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 02:40AM PDT, ID: 22077350

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 02:41AM PDT, ID: 22077357

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 02:00PM PDT, ID: 22092264

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 05:27PM PDT, ID: 22093118

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Apache Web Server, PHP and Databases, Web Servers
Tags: Apache, Mod_rewrite
Sign Up Now!
Solution Provided By: caterham_www
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.25.2008 at 08:21PM PDT, ID: 22093614

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2008 at 04:11PM PDT, ID: 22099866

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2008 at 04:14PM PDT, ID: 22099876

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628