URL friendly with HTACCESS

1

I'm doing my system that will use friendly URL with htaccess, but I have a question / problem. My HTACCESS is as follows:

RewriteEngine ON

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?page=$1

It works when I access something like www.mysite.com/address , but I have another URL that I have to access as the URL above, except that this is www. mysite.co.uk/view/ficha/6

VIEW = view.php FILE = category 6 = ID

I need to pass this data to the viewer.php file that is in the pages folder

    
asked by anonymous 21.07.2014 / 04:06

1 answer

1

The ideal scenario is that you focus your routing on the application itself, making it more flexible and dynamic, and simplifying webserver redirects.

In any case, except for the rule that forwards all accesses to non-existent files and directories, you can add the line below before the last one:

RewriteRule ^visualizar/ficha/([0-9]+)$ pages/visualizar.php?categoria=$1
    
21.07.2014 / 04:51