• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL rewriting problem

#1
I'm locked with my system... I changed the settings in my config.php file to have URLs with parameters. Suddenly I have a product controller that displays the id that I pass URL parameter.

http://localhost:8888/mywebsite/index.php?c=product&m=index&id_product=12

This URL works now I want to get a url of the type:

http://localhost:8888/mywebsite/product/my-product-12

So I put this in the .htaccess file:



Code:
RewriteRule ^product/([a-zA-Z0-9\-]+)-([0-9]+).html$ index.php?c=product&m=index&id_product=$2 [L]

But the page displays : The requested URL /index.php/product/my-product-12.html was not found on this server.

My htaccess file :


Code:
#Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1         [L,QSA]

RewriteRule ^product/([a-zA-Z0-9\-]+)-([0-9]+).html$ index.php?c=product&m=index&id_product=$2 [L]
My config.php file :

My config.php file:


Code:
<?php

$config['base_url'] = 'http://localhost:8888/mywebsite/';
$config['index_page'] = '';
$config['uri_protocol'] = 'QUERY_STRING';
$config['url_suffix'] = '';
$config['enable_hooks'] = TRUE;
$config['allow_get_array']      = TRUE;
$config['enable_query_strings'] = TRUE;
$config['controller_trigger']   = 'c';
$config['function_trigger']     = 'm';
$config['directory_trigger']    = 'd';
$config['rewrite_short_tags'] = FALSE;

?>
Reply


Messages In This Thread
URL rewriting problem - by xenos92 - 07-05-2016, 06:39 AM
RE: URL rewriting problem - by RogerMore - 07-08-2016, 01:46 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.