PDA

View Full Version : htaccess


cocoonfx
07-04-2012, 04:21 PM
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.

http://www.yourdomain.co.uk/shop.php?sec=cat&cat=5&category=stools

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&cat=5&category=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?

edbr
07-05-2012, 03:47 AM
http://www.generateit.net/mod-rewrite/ is pretty good

edbr
07-05-2012, 03:50 AM
RewriteEngine On
RewriteRule ^category/([^/]*)\.html$ /shop.php?sec=cat&cat=5&category=$1 [L]


gives
http://www.yourdomain.co.uk/category/stools.html

cocoonfx
07-05-2012, 09:05 AM
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

gentleone
07-05-2012, 09:06 AM
Yes, the RewriteEngine On could have been the issue, because most servers have mod_rewrite off by default.

cocoonfx
07-05-2012, 09:08 AM
That would make sense I am going to call the people who built this system. Its a hash between Drupal, Oscommerce and Zen cart...