Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.
Moderator: General Moderators
onion2k
Jedi Mod
Posts: 5263 Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com
Post
by onion2k » Sat Oct 11, 2008 6:56 am
I think you need to backslash the forward slashes, and the second part should be using references rather than .* ... eg
Code: Select all
Rewriterule '^mens\/item\/(.*)\/(.*)\/(.*)\/(.*)\/? mens-item-($1)-($2)-($3)-($4).html [R=301, NC, L]
The \/? at the end of the first part is just in case the user pops a / on the end of the URL.
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Sat Oct 11, 2008 7:09 am
Unfortunately that gives me an internal server error as well and i dont know anyway to get any error messages that can shed light on the error.
Just in case it helps, my full .htaccess file:
Code: Select all
ErrorDocument 404 http://www.redsquareclothing.co.uk/404.php
AddType x-mapp-php4 .php
RewriteEngine on
ReWriteBase /
RewriteRule ^mens/sale$ showSale.php [L]
RewriteRule ^mens/site-map$ sitemap.php [L]
RewriteRule ^mens/brands$ brandList.php [L]
RewriteRule ^mens/item/([0-9]+)/(.*)/(.*)$ showItem.php?stockCode=$1 [L]
RewriteRule ^mens/cat/([0-9]+)/(.*)/([0-9]+)/(.*)$ showCategories.php?catID=$1&page=$3&amount=$4 [L]
RewriteRule ^mens/brand/([0-9]+)/(.*)$ showBrand.php?brandID=$1 [L]
RewriteRule ^mens/brand_cat/([0-9]+)/(.*)/(.*)/(.*)$ showListings.php?brandID=$1&catID=$2 [L]
RewriteRule ^article/([0-9]+)/(.*)$ readArticle.php?id=$1 [L]
RewriteRule ^mens/sale/([0-9]+)/(.*)$ showSale.php?catID=$1 [L]
Options +FollowSymlinks
rewritecond %{http_host} ^redsquareclothing.co.uk [nc]
rewriterule ^(.*)$ http://www.redsquareclothing.co.uk/$1 [r=301,nc]
RewriteCond %{HTTP_HOST} ^(www.)?redsquareclothing.com
RewriteRule ^(.*) http://www.redsquareclothing.co.uk/$1 [R=301,L]
onion2k
Jedi Mod
Posts: 5263 Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com
Post
by onion2k » Sat Oct 11, 2008 8:05 am
Ah.. cut and paste error ... there's an apostrophe at the start of the rule that shouldn't be there.
malcolmboston
DevNet Resident
Posts: 1826 Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK
Post
by malcolmboston » Sat Oct 11, 2008 9:07 am
same
Code: Select all
ErrorDocument 404 http://www.redsquareclothing.co.uk/404.php
AddType x-mapp-php4 .php
RewriteEngine on
ReWriteBase /
RewriteRule ^mens/sale$ showSale.php [L]
RewriteRule ^mens/site-map$ sitemap.php [L]
RewriteRule ^mens/brands$ brandList.php [L]
RewriteRule ^mens/item/([0-9]+)/(.*)/(.*)$ showItem.php?stockCode=$1 [L]
RewriteRule ^mens/cat/([0-9]+)/(.*)/([0-9]+)/(.*)$ showCategories.php?catID=$1&page=$3&amount=$4 [L]
RewriteRule ^mens/brand/([0-9]+)/(.*)$ showBrand.php?brandID=$1 [L]
RewriteRule ^mens/brand_cat/([0-9]+)/(.*)/(.*)/(.*)$ showListings.php?brandID=$1&catID=$2 [L]
RewriteRule ^article/([0-9]+)/(.*)$ readArticle.php?id=$1 [L]
RewriteRule ^mens/sale/([0-9]+)/(.*)$ showSale.php?catID=$1 [L]
Options +FollowSymlinks
rewritecond %{http_host} ^redsquareclothing.co.uk [nc]
rewriterule ^(.*)$ http://www.redsquareclothing.co.uk/$1 [r=301,nc]
RewriteCond %{HTTP_HOST} ^(www.)?redsquareclothing.com
RewriteRule ^(.*) http://www.redsquareclothing.co.uk/$1 [R=301,L]
Rewriterule ^mens\/item\/(.*)\/(.*)\/(.*)\/(.*)\/? mens-item-($1)-($2)-($3)-($4).html [R=301, NC, L]
is there anyway to actually find the cause of the error?