On my main page, the navigation links are as follows:
- localhost/inventory/add
- localhost/inventory/view
The code for those are:
<a href='add'>Add Record</a>
<a href='view'>View Records</a>
and my .htaccess file is:
RewriteEngine on
RewriteRule ^([^/\.]+)/?$ ./index.php?url=$1 [L]
RewriteRule ^([^/\.]+)/?/([^/\.]+)/?$ ./index.php?url=$1&id=$2 [L]
The problem I am having is that for the records, there is an edit link that takes them to:
- localhost/inventory/edit/1
For record one, and the code for that link is:
<a href='edit/1'>Edit</a>
Which is fine, except now the navigation links take them to:
- localhost/inventory/edit/add
- localhost/inventory/edit/view
Because it thinks it is in an 'edit' directory.
Does anyone know of an idea to overcome this problem?
Thank you!