Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
hi all,

I just tried Pretty URL's on my localhost running XAMPP, PHP 5.3.80 -> MySQL 5.0.8 -> Apache 2.2.21 but now get 404 errors, I have generated the .htaccess file.

Only my index,php is shown, all other pages generate 404 errors.

Please help.


.htaccess file content :

Code: Select all
Options +FollowSymlinks -MultiViews
<IfModule mod_rewrite.c>
RewriteEngine On

#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it RewriteBase /subdomain1/subdomain2
RewriteBase /couch

#If you wish to use a custom 404 page, place a file named 404.php in your website's root and uncomment the line below.
#If your website is installed in a subfolder, change the line below to reflect the path to the subfolder.
#e.g. for http://www.example.com/subdomain1/subdomain2/ make it ErrorDocument 404 /subdomain1/subdomain2/404.php
#ErrorDocument 404 /404.php

#If your site begins with 'www', uncomment the following two lines
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]


#DO NOT EDIT BELOW THIS


RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule . - [L]

#war-medals.php
RewriteRule ^war-medals$ "$0/" [R=301,L,QSA]
RewriteRule ^war-medals/$ war-medals.php [L,QSA]
RewriteRule ^war-medals/.*?([^\.\/]*)\.html$ war-medals.php?pname=$1 [L,QSA]
RewriteRule ^war-medals/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ war-medals.php?d=$1$2$3 [L,QSA]
RewriteRule ^war-medals/[^\.]*?([^/\.]*)/$ war-medals.php?fname=$1 [L,QSA]
RewriteRule ^war-medals/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#railway-antiques.php
RewriteRule ^railway-antiques$ "$0/" [R=301,L,QSA]
RewriteRule ^railway-antiques/$ railway-antiques.php [L,QSA]
RewriteRule ^railway-antiques/.*?([^\.\/]*)\.html$ railway-antiques.php?pname=$1 [L,QSA]
RewriteRule ^railway-antiques/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ railway-antiques.php?d=$1$2$3 [L,QSA]
RewriteRule ^railway-antiques/[^\.]*?([^/\.]*)/$ railway-antiques.php?fname=$1 [L,QSA]
RewriteRule ^railway-antiques/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#queen-ann-stoves.php
RewriteRule ^queen-ann-stoves$ "$0/" [R=301,L,QSA]
RewriteRule ^queen-ann-stoves/$ queen-ann-stoves.php [L,QSA]
RewriteRule ^queen-ann-stoves/.*?([^\.\/]*)\.html$ queen-ann-stoves.php?pname=$1 [L,QSA]
RewriteRule ^queen-ann-stoves/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ queen-ann-stoves.php?d=$1$2$3 [L,QSA]
RewriteRule ^queen-ann-stoves/[^\.]*?([^/\.]*)/$ queen-ann-stoves.php?fname=$1 [L,QSA]
RewriteRule ^queen-ann-stoves/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#old-coins.php
RewriteRule ^old-coins$ "$0/" [R=301,L,QSA]
RewriteRule ^old-coins/$ old-coins.php [L,QSA]
RewriteRule ^old-coins/.*?([^\.\/]*)\.html$ old-coins.php?pname=$1 [L,QSA]
RewriteRule ^old-coins/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ old-coins.php?d=$1$2$3 [L,QSA]
RewriteRule ^old-coins/[^\.]*?([^/\.]*)/$ old-coins.php?fname=$1 [L,QSA]
RewriteRule ^old-coins/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#old-bank-notes.php
RewriteRule ^old-bank-notes$ "$0/" [R=301,L,QSA]
RewriteRule ^old-bank-notes/$ old-bank-notes.php [L,QSA]
RewriteRule ^old-bank-notes/.*?([^\.\/]*)\.html$ old-bank-notes.php?pname=$1 [L,QSA]
RewriteRule ^old-bank-notes/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ old-bank-notes.php?d=$1$2$3 [L,QSA]
RewriteRule ^old-bank-notes/[^\.]*?([^/\.]*)/$ old-bank-notes.php?fname=$1 [L,QSA]
RewriteRule ^old-bank-notes/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#hallmarked-silver.php
RewriteRule ^hallmarked-silver$ "$0/" [R=301,L,QSA]
RewriteRule ^hallmarked-silver/$ hallmarked-silver.php [L,QSA]
RewriteRule ^hallmarked-silver/.*?([^\.\/]*)\.html$ hallmarked-silver.php?pname=$1 [L,QSA]
RewriteRule ^hallmarked-silver/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ hallmarked-silver.php?d=$1$2$3 [L,QSA]
RewriteRule ^hallmarked-silver/[^\.]*?([^/\.]*)/$ hallmarked-silver.php?fname=$1 [L,QSA]
RewriteRule ^hallmarked-silver/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#gold.php
RewriteRule ^gold$ "$0/" [R=301,L,QSA]
RewriteRule ^gold/$ gold.php [L,QSA]
RewriteRule ^gold/.*?([^\.\/]*)\.html$ gold.php?pname=$1 [L,QSA]
RewriteRule ^gold/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ gold.php?d=$1$2$3 [L,QSA]
RewriteRule ^gold/[^\.]*?([^/\.]*)/$ gold.php?fname=$1 [L,QSA]
RewriteRule ^gold/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#foreign-currency.php
RewriteRule ^foreign-currency$ "$0/" [R=301,L,QSA]
RewriteRule ^foreign-currency/$ foreign-currency.php [L,QSA]
RewriteRule ^foreign-currency/.*?([^\.\/]*)\.html$ foreign-currency.php?pname=$1 [L,QSA]
RewriteRule ^foreign-currency/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ foreign-currency.php?d=$1$2$3 [L,QSA]
RewriteRule ^foreign-currency/[^\.]*?([^/\.]*)/$ foreign-currency.php?fname=$1 [L,QSA]
RewriteRule ^foreign-currency/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#dinky-toys.php
RewriteRule ^dinky-toys$ "$0/" [R=301,L,QSA]
RewriteRule ^dinky-toys/$ dinky-toys.php [L,QSA]
RewriteRule ^dinky-toys/.*?([^\.\/]*)\.html$ dinky-toys.php?pname=$1 [L,QSA]
RewriteRule ^dinky-toys/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ dinky-toys.php?d=$1$2$3 [L,QSA]
RewriteRule ^dinky-toys/[^\.]*?([^/\.]*)/$ dinky-toys.php?fname=$1 [L,QSA]
RewriteRule ^dinky-toys/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#diamonds.php
RewriteRule ^diamonds$ "$0/" [R=301,L,QSA]
RewriteRule ^diamonds/$ diamonds.php [L,QSA]
RewriteRule ^diamonds/.*?([^\.\/]*)\.html$ diamonds.php?pname=$1 [L,QSA]
RewriteRule ^diamonds/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ diamonds.php?d=$1$2$3 [L,QSA]
RewriteRule ^diamonds/[^\.]*?([^/\.]*)/$ diamonds.php?fname=$1 [L,QSA]
RewriteRule ^diamonds/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#coins-in-the-news.php
RewriteRule ^coins-in-the-news$ "$0/" [R=301,L,QSA]
RewriteRule ^coins-in-the-news/$ coins-in-the-news.php [L,QSA]
RewriteRule ^coins-in-the-news/.*?([^\.\/]*)\.html$ coins-in-the-news.php?pname=$1 [L,QSA]
RewriteRule ^coins-in-the-news/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ coins-in-the-news.php?d=$1$2$3 [L,QSA]
RewriteRule ^coins-in-the-news/[^\.]*?([^/\.]*)/$ coins-in-the-news.php?fname=$1 [L,QSA]
RewriteRule ^coins-in-the-news/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#brass-copperware.php
RewriteRule ^brass-copperware$ "$0/" [R=301,L,QSA]
RewriteRule ^brass-copperware/$ brass-copperware.php [L,QSA]
RewriteRule ^brass-copperware/.*?([^\.\/]*)\.html$ brass-copperware.php?pname=$1 [L,QSA]
RewriteRule ^brass-copperware/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ brass-copperware.php?d=$1$2$3 [L,QSA]
RewriteRule ^brass-copperware/[^\.]*?([^/\.]*)/$ brass-copperware.php?fname=$1 [L,QSA]
RewriteRule ^brass-copperware/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#antique-pocket-watches.php
RewriteRule ^antique-pocket-watches$ "$0/" [R=301,L,QSA]
RewriteRule ^antique-pocket-watches/$ antique-pocket-watches.php [L,QSA]
RewriteRule ^antique-pocket-watches/.*?([^\.\/]*)\.html$ antique-pocket-watches.php?pname=$1 [L,QSA]
RewriteRule ^antique-pocket-watches/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ antique-pocket-watches.php?d=$1$2$3 [L,QSA]
RewriteRule ^antique-pocket-watches/[^\.]*?([^/\.]*)/$ antique-pocket-watches.php?fname=$1 [L,QSA]
RewriteRule ^antique-pocket-watches/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#antique-jewellery.php
RewriteRule ^antique-jewellery$ "$0/" [R=301,L,QSA]
RewriteRule ^antique-jewellery/$ antique-jewellery.php [L,QSA]
RewriteRule ^antique-jewellery/.*?([^\.\/]*)\.html$ antique-jewellery.php?pname=$1 [L,QSA]
RewriteRule ^antique-jewellery/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ antique-jewellery.php?d=$1$2$3 [L,QSA]
RewriteRule ^antique-jewellery/[^\.]*?([^/\.]*)/$ antique-jewellery.php?fname=$1 [L,QSA]
RewriteRule ^antique-jewellery/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

#antique-ironware.php
RewriteRule ^antique-ironware$ "$0/" [R=301,L,QSA]
RewriteRule ^antique-ironware/$ antique-ironware.php [L,QSA]
RewriteRule ^antique-ironware/.*?([^\.\/]*)\.html$ antique-ironware.php?pname=$1 [L,QSA]
RewriteRule ^antique-ironware/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ antique-ironware.php?d=$1$2$3 [L,QSA]
RewriteRule ^antique-ironware/[^\.]*?([^/\.]*)/$ antique-ironware.php?fname=$1 [L,QSA]
RewriteRule ^antique-ironware/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]
</IfModule>
Hi Devan,

1. Please make sure that your server has the required mod_rewrite module enabled. You can use the following utility for testing this -
viewtopic.php?p=11832#p11832

2. If the above test come up OK, try removing the very first line from the .htaccess file i.e.
Options +FollowSymlinks -MultiViews

Hope this helps.
hi KK,

thanks for the reply, I tested with your utility, mod-rewrite is set, I also removed the first line in the .htaccess file as you have mentioned but still I get 404 errors, I cleared the browser cache, but still no go.
Well, in that case I suggest you work without prettyURLs so long as the site is on your local system. Turn them on once you go live. Local stacks are known to be flaky and I am sure you won't see this problem on a proper hosted server.
4 posts Page 1 of 1