admin管理员组文章数量:1305207
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
本文标签: url rewritingWordpress dynamic page handle in theme
版权声明:本文标题:url rewriting - Wordpress dynamic page handle in theme 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741752869a2395937.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论