Skip to content
Advertisement

How can use friendly url with htdocs?

I have a website with URLS variables, but i can change for friendly urls like:

https://www.kanarinolta.es/impresion-oficina?name=bizhub&model=C650i

to this:

https://www.kanarinolta.es/impresion-oficina/bizhub-C650i/

I tried with this in htdocs file:

RewriteRule ^index/([^/]+)/([^/]+).php /impresion-oficina?name=$1&model=$2 [NC]

But doesn’t work.

Advertisement

Answer

First, make sure mod_rewrite is enabled and htaccess files allowed in your Apache configuration.

RewriteRule ^impresion-oficina/([A-Za-z0-9]+)-([A-Za-z0-9]+)$ impresion-oficina?name=$1&model=$2 [NC]

Should work for :

www.kanarinolta.es/impresion-oficina?name=bizhub&model=C650i

to

www.kanarinolta.es/impresion-oficina/bizhub-C650i/
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement