Welcome Guest, Not a member yet? Register   Sign In
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.ph...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, 05:39 AM
RE: URL rewriting problem - by RogerMore - 07-08-2016, 12:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB