homepage Welcome to WebmasterWorld Guest from 54.196.197.153
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
mod_rewrite assistance
mod_rewrite problem
MonkeyAllen




msg:1520435
 6:48 pm on Jul 3, 2002 (gmt 0)
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




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

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




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

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]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved