You are here:  » 404 error

Support Forum



404 error

Submitted by marco@flapper on Tue, 2011-06-21 09:22 in

Hi,
I added a new PT website with the 'one folder up' mod (http://www.pricetapestry.com/node/3773).

I changed the htaccess but seem to have made a mistake in it as I get a 404 error when I click on a product on the frontpage. Can you take a look on it?

The url is:
http://www.example.nl/ebook/

And I added the following to the htacess file

RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^merchant/$ ebook/merchants.php [L]
RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^categorie/$ ebook/categories.php [L]
RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^brand/$ ebook/brands.php [L]
RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^merchant/(.*)/$ ebook/search.php?q=merchant:$1:&rewrite=1&%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^merchant/(.*)/(.*).html$ ebook/search.php?q=merchant:$1:&page=$2&rewrite=1&%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^categorie/(.*)/$ ebook/search.php?q=category:$1:&rewrite=1&%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^categorie/(.*)/(.*).html$ ebook/search.php?q=category:$1:&page=$2&rewrite=1&%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^brand/(.*)/$ ebook/search.php?q=brand:$1:&rewrite=1&%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^brand/(.*)/(.*).html$ ebook/search.php?q=brand:$1:&page=$2&rewrite=1&%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} ^www\example\.nl [NC]
RewriteRule ^product/(.*).html$ ebook/products.php?q=$1&%{QUERY_STRING} [L]

Submitted by support on Tue, 2011-06-21 11:04

Hello Marco,

To rewrite to that level the rules will actually have to go in the top level .htaccess, e.g. example.nl/.htaccess rather than example.nl/ebook/.htaccess - that should be all it is - make sure that in that top level .htaccess that RewriteBase is /, e.g.

RewriteBase /

Hope this helps,

Cheers,
David.
--
PriceTapestry.com

Submitted by marco@flapper on Tue, 2011-06-21 11:53

Hi,
I did put it in the top level htaccess and it has the RewriteBase in it. But it doesn't work.

I think I'm missing something. What I did was copy an old PT installation and changed the database details. I then ran setup.php and made the addidition to the top level htaccess.

Submitted by support on Tue, 2011-06-21 12:47

Hi marco,

As a test to make sure that the .htaccess is being invoked, could you change the last rule:

RewriteRule ^product/(.*).html$ ebook/products.php?q=$1&%{QUERY_STRING} [L]

...to;

RewriteRule ^product/(.*).html$ ebook/products.php?q=$1&%{QUERY_STRING} [L,R=302]

That will make it perform a redirect rather than internal rewrite and would confirm that .htaccess is being processed for the top level URLs.

If you're still not sure, please could you email me a link to the installation and a copy of .htaccess from both the top level and I'll check it out further - it's not actually a rewrite scenario that I'm familiar with so I'll set up the same scenario no my test server...

Cheers,
David.
--
PriceTapestry.com

Submitted by marco@flapper on Tue, 2011-06-21 15:29

Hi,
Thanks for your support. I had a . missing in the rewriterules.