logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > HTML and CSS
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 07-04-2012, 04:21 PM   #1
cocoonfx
cocoonfx's Avatar
 
Join Date: Nov 2006
Location: Tamworth,UK
Posts: 576
Default htaccess

Hi

I am trying to write a URL using the htaccess and it doesn't matter what I try the htaccess rule is not working.

HTML Code:
http://www.yourdomain.co.uk/shop.php?sec=cat&cat=5&category=stools
HTML Code:
RewriteCond %{HTTP_HOST} ^yourdomain\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.co\.uk$
RewriteRule ^"http\:\/\/www\.yourdomain\.co\.uk\/shop\.php\"
The online tester shows the its sort of working.

http://www.yourdomain.co.uk/?sec=cat...ategory=stools

I want the domain to be http://www.yourdomain.co.uk.co.uk/category/stools

any ideas or know of any tools to assist?
cocoonfx is offline   Reply With Quote
Old 07-05-2012, 03:47 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

http://www.generateit.net/mod-rewrite/ is pretty good
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 07-05-2012, 03:50 AM   #3
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

RewriteEngine On
RewriteRule ^category/([^/]*)\.html$ /shop.php?sec=cat&cat=5&category=$1 [L]


gives
http://www.yourdomain.co.uk/category/stools.html
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 07-05-2012, 09:05 AM   #4
cocoonfx
cocoonfx's Avatar
 
Join Date: Nov 2006
Location: Tamworth,UK
Posts: 576
Default

Hi Edbr


Thanks for the reply but it doesn't work.

This works on my site but crashes the site I am working on....

RewriteCond %{HTTP_HOST} ^cocoonfxmedia\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.cocoonfxmedia\.co\.uk$
RewriteRule ^shop/product_info\.php\/?(.*)$ "http\:\/\/www\.cocoonfxmedia\.co\.uk\/shop/" [R=301,L]

This returns http://www.cocoonfxmedia.co.uk/shop/?product=25

There must be something the web host is doing or may be some PHP is contolling the URL rewrites... not sure
cocoonfx is offline   Reply With Quote
Old 07-05-2012, 09:06 AM   #5
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

Yes, the RewriteEngine On could have been the issue, because most servers have mod_rewrite off by default.
__________________
www.gentlemedia.nl
gentleone is offline   Reply With Quote
Old 07-05-2012, 09:08 AM   #6
cocoonfx
cocoonfx's Avatar
 
Join Date: Nov 2006
Location: Tamworth,UK
Posts: 576
Default

That would make sense I am going to call the people who built this system. Its a hash between Drupal, Oscommerce and Zen cart...
cocoonfx is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:53 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com