Advertisement:

Author Topic: Error rewriting item.php, 404 no item found  (Read 4445 times)

sigmoun

  • Newbie
  • *
  • Posts: 5
Error rewriting item.php, 404 no item found
« on: November 27, 2010, 04:41:56 pm »
Hello guys,

thanks for your script, it looks really pretty.
i've nearly finish the translation in full french btw, i will send it to you asap. (better french than actually)

after issued the bug for category, i'm now working on another bug with the item rewrite url.

my item pages are show as 404 in my error log, & i have no result on the site.

ex : http://www.placepublique.be/vehicules/automobile/break-bmw-535-da-boite-automatique-1
the non rewrite uri works : -http://www.placepublique.be/item.php?id=1

the htaccess rules looks like definitely not correct :

Code: [Select]
RewriteRule -(\d+)$ item.php?id=$1 [NC,L]
eg : error log : File does not exist: /home/placepub/public_html/petits-services/depannage-informatique/formatage-reinstallation-dordinateurs-2

could you please give us the right rule ?

Best regards
« Last Edit: November 27, 2010, 04:52:15 pm by sigmoun »

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Error rewriting item.php, 404 no item found
« Reply #1 on: November 29, 2010, 05:54:43 pm »
I'm not sure what is really happening... The rewrite rule looks fine but is not working... Could give us more info? Like which is script is loading? Maybe you can print $_SERVER var in the header so you will know which file is running.

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Error rewriting item.php, 404 no item found
« Reply #2 on: November 29, 2010, 05:56:58 pm »
By the way, You can send the translation when you finish to juanramon@osclass.org

HimSelf

  • Full Member
  • ***
  • Posts: 163
Re: Error rewriting item.php, 404 no item found
« Reply #3 on: November 29, 2010, 06:33:44 pm »
Hello,

the php self return /index.php

so it's definitely not the good file.

thanks for your attention.

Quote
php self :/index.php
php query :action=errorPage&code=404
php file :/home/placepub/public_html/index.php

i've left the SERVER variable on site, like that you can see by yourself
« Last Edit: November 29, 2010, 06:39:44 pm by HimSelf »

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Error rewriting item.php, 404 no item found
« Reply #4 on: December 01, 2010, 02:11:31 pm »
I was thinking about it... Can you modify .htaccess and write:
Code: [Select]
RewriteBase /home/placepub/public_html/Place it just after this line
Code: [Select]
RewriteEngine OnI hope it works :-)

HimSelf

  • Full Member
  • ***
  • Posts: 163
Re: Error rewriting item.php, 404 no item found
« Reply #5 on: December 01, 2010, 02:34:53 pm »
hello,
 
no it's not :'(

this bring me a 404 also in category pages !
& it's not resolving the itemp problem.

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Error rewriting item.php, 404 no item found
« Reply #6 on: December 01, 2010, 02:36:34 pm »
And now which is the error log? Could you paste the whole .htaccess file?

HimSelf

  • Full Member
  • ***
  • Posts: 163
Re: Error rewriting item.php, 404 no item found
« Reply #7 on: December 02, 2010, 08:19:25 am »
[Thu Dec  2 06:16:59 2010] [error] [client xxx.xxx.141.80] File does not exist: /home/placepub/public_html/vehicules/automobile/break-bmw-535-da-boite-automatique-1

Quote
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /home/placepub/public_html/

#Pages: contact, feed, sitemap
RewriteRule ^contact(.html)?$ index.php?action=contact [NC,L]
RewriteRule ^feed.xml$ index.php?action=feed [NC,L]
RewriteRule ^sitemap.xml$ index.php?action=sitemap [NC,L]

#Advertisements
RewriteRule -(\d+)$ item.php?id=$1 [NC,L]

#Static pages
RewriteRule -p(\d+)$ page.php?id=$1 [NC,L]

#Redirect 301 of first page of category
RewriteCond %{REQUEST_URI} !^((oc-admin)|(oc-content)|(oc-includes)).*
RewriteRule ^([a-zA-Z\_\-]+/([a-zA-Z\_\-]*/)?)1/?$ $1 [R=301,L]

#Categories
RewriteRule ^([a-zA-Z\_\-]+/([a-zA-Z\_\-]*/)?)(\d+)/?$ category.php?slug=$1&page=$3 [NC,L]
RewriteCond %{REQUEST_URI} !^/((oc-admin)|(oc-includes)|(oc-content)).*
RewriteRule ^([a-zA-Z\_\-]+)$ $1/ [R=301,L]
RewriteCond %{REQUEST_URI} !^/((oc-admin)|(oc-includes)|(oc-content)).*
#RewriteRule ^([a-zA-Z\_\-]+/[a-zA-Z\_\-]*?)/?$ category.php?slug=$1&page=1 [NC,L]
RewriteRule ^([a-zA-Z\_\-]+/([a-zA-Z\_\-]*)?)/?$ category.php?slug=$1&page=1 [NC,L]

ErrorDocument 404 /index.php?action=errorPage&code=404
ErrorDocument 500 /index.php?action=errorPage&code=500
</IfModule>

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Error rewriting item.php, 404 no item found
« Reply #8 on: December 02, 2010, 01:59:43 pm »
I have two more options:
    1) RewriteRule \-([0-9]+)$ item.php?id=$1 [NC,L]
    2) RewriteRule ^.*?\-([0-9]+)$ item.php?id=$1 [NC,L]

I hope one of this works because I'm running out of ideas.

HimSelf

  • Full Member
  • ***
  • Posts: 163
Re: Error rewriting item.php, 404 no item found
« Reply #9 on: December 02, 2010, 04:58:53 pm »
YES !

you're a king :-)

it works with 1st rewrite rule :-)

thanks a lot !

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Error rewriting item.php, 404 no item found
« Reply #10 on: December 02, 2010, 05:24:33 pm »
Great!! You'll have to do the same with the Static Pages rule:
    - RewriteRule \-p([0-9]+)$ item.php?id=$1 [NC,L]

I'll fix in the code too!