I am creating a wordpress theme
My index.php is working great
I would like only 3 urls on my website
/
which is going to wp-content/themes/my-theme/index.php or an ther fine I do not have problem with file name/url1
which is going to wp-content/themes/my-theme/dynamic.php/url2
which is going to wp-content/themes/my-theme/dynamic.php
I already made some intents updating the htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wp-content/themes/my-theme/dynamic.php?path=$1 [NC,L,QSA]
But the wordpress logic is only loaded on /
on the other urls I can not call wordpress functions.
I also made some tests with add_rewrite_rule
but apache is returning me a 404 if I am not going to /
To sum up I would like all my urls managed by a single file then I will be doing the dispatch with php logic, this logic should also handle the root path (/
)
The only url I do not want to rewrite is /wp-admin