Welcome to WebmasterWorld Guest from 54.146.239.96

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

mod_rewrite assistance

mod_rewrite problem

     

MonkeyAllen

6:48 pm on Jul 3, 2002 (gmt 0)

10+ Year Member


Hi Guys,
We are making some headway with our mod_rewrite issue. our main problem is that google when trying to crawl our URLS is messing up our URL and is trying to access:

http://www.example.com/reviews/index.php%3Faction=fullreview&id=148

Insead of:

http://www.example.com/reviews/index.php?action=fullreview&id=148

Right now we were able to tell the server to parse http://www.example.com/reviews/148.html
AS
http://www.example.com/reviews/index.php?action=fullreview&id=148

What were having a hardtime working out is to tell the server to parse/redirect

http://www.example.com/reviews/index.php%3Faction=fullreview&id=148
Into
http://www.example.com/reviews/148.html

Our current .htaccess file looks like this,

RewriteEngine on
RewriteBase /reviews
RewriteRule ^(.*)\.html$ index.php?action=fullreview&id=$1

Does anyone know how to tell it what we want? It is only google were concerned with.

Many thanks in advance.
Chris

mdharrold

10:27 pm on Jul 3, 2002 (gmt 0)

10+ Year Member



The reason is that you are telling it to only rewrite if the string ends with ".html" but the url you gave that google is using does not contain ".html".

Someone will correct me if I'm wrong, but I believe if you change your .htaccess to read:

RewriteEngine on
RewriteBase /reviews
RewriteRule ^(.*)\.html$ index.php?action=fullreview&id=$1 [L]
RewriteRule ^(.*)action=(a-z+)&id=(0-9+)$ index.php?action=$1&id=$2 [L]

it should match all of the following:
[example.com...]
[example.com...]
[example.com...]

MonkeyAllen

4:18 pm on Jul 4, 2002 (gmt 0)

10+ Year Member



Unfortunatly when i added this, it still gives me a 404 file not found error when trying to access the page using:

[example.com...]

Anymore ideas anyone??

[edited by: DaveAtIFG at 8:01 pm (utc) on July 4, 2002]

 

Featured Threads

Hot Threads This Week

Hot Threads This Month