I try to build a seo friendly url system like stackoverflow.
Example:
https://domain.com/cat/{id}/topic-title
But, there are issues because url rewrite.
1 - Break links
https://domain.com/cat/css/style.css
https://domain.com/cat/img/favicon.png
2 - Keep the current directory when navigate
https://domain.com/cat/cat/{id}/topic-name
my .htaccess
Options -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^cat/(.*)$ category.php?current=$1 [L]
my hyperlink
<a href="cat/<?php echo $topic; ?>" class="mdl-layout__tab<?php if ($current == $topic) {echo ' is-active';}?>"><?php echo $topic; ?></a>
Sorry for my poor English.