admin管理员组文章数量:1122846
I have a portfolio site that I would also like to make a demo site for some of my client work. Basically, I would like to serve a subfolder statically along side the WordPress install. For instance, if I have .html
that index file would be served directly from Apache rather than WordPress. I have root access to my server, just not sure how to implement this
I have a portfolio site that I would also like to make a demo site for some of my client work. Basically, I would like to serve a subfolder statically along side the WordPress install. For instance, if I have http://example.com/demo/subfolder/index.html
that index file would be served directly from Apache rather than WordPress. I have root access to my server, just not sure how to implement this
4 Answers
Reset to default 9If the files are static HTML, then you only need to be concerned with name collisions for the directory structure. And if you don't have anything in WordPress that generates /demo/subfolder/ you don't have to worry about ignoring it - it's already ignored.
I have a sandbox folder that I use for a similar purpose as you and haven't had to implement anything - It's ignored by WordPress already.
For anyone with the same question, you can use my plugin available at Wordpress repository: WP Custom HTML Pages
It allows you to serve static HTML pages at custom URI of your choice.
1) Install and activate the plugin
2) Use the new submenu item (Pages->HTML Pages) to create a new HTML page
3) In "Page Permalink" field enter the custom URI you wish to assign to your page, for example /my-html-page (at the time of writing this answer, it is required that the value you enter starts with "/" character) and in "HTML Page Code" field enter all the HTML and CSS of the page document that you wish to display
4) Click "Publish" then go to yourwebsite.com/my-html-page and you should see your static HTML page, providing its status is set to "published"
By creating and linking several pages you may have a whole static website.
You can request WordPress to ignore the subdirectory structure by adding these rules in .htaccess. Add them within <Ifmodule mod_rewrite.c>
But generally if there is no page such as demo, WordPress ignores it and the static page is rendered.
RewriteCond %{REQUEST_URI} ^/Demo_directory/(.*)$
Old thread, still for someone if needed. This can easily be done using Serve Static =>(https://wordpress.org/plugins/serve_static/) plugin. This automatically creates raw static HTML files, and serves them to visitors.
本文标签: directoryHow do I serve static content on same domain as WordPress
版权声明:本文标题:directory - How do I serve static content on same domain as WordPress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302801a1931663.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论