.htaccess URL friendly PHP problem

0

I have a link like this:

<a href="index/pagina=$i"> $i </a>

I wanted the URL to look like this:

index/2

And I'm using .htaccess like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index?$ index.php [NC,L]
RewriteRule ^index/([a-z0-9-]+)/?$ index.php?pagina=$1 [NC]
</IfModule>

Where is the problem?

    
asked by anonymous 18.01.2015 / 18:35

1 answer

0

It seems like the problem is in href of your a . The .htaccess is correct but the link you are printing is not.

It should be like this (to generate index / $ i)

<a href="index/$i"> $i </a>
    
18.01.2015 / 19:30