Django网站上的WordPress博客在CPANEL主机上

发布于 2025-01-30 03:48:52 字数 242 浏览 4 评论 0原文

当我在线阅读文章和问题时,我相信这是可能的。我的主要问题是如何实现这一目标?

我在域上有一些URL的Django网站(我在cpanel上使用python应用程序插件)。我可以简单地使用子域来实现这一目标,但是我想在子目录上运行我的WordPress博客,但是在URL中未注册的每个URL都会引起错误。

实现这一目标的最佳方法是什么?
我需要采取什么步骤?

如果您将我指向正确的方向,我将是奇怪的。
提前致谢。

As I read articles and questions online, I believe it is possible; My main question is how to achieve this goal?

I have Django Website with some urls on my domain (I use Setup Python App plugin on CPanel). I can simply achieve this using a subdomain, but I want to run my WordPress blog on a subdirectory, but every url that is not registered in urls.py will raise an error.

What's the best way to reach this goal?

What are the steps that I need to take to reach it?

I will be more than greatful if you point me towards the right direction.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

素衣风尘叹 2025-02-06 03:48:53

我正在浏览此问题,并发布了一个问题,其问题是基本目录中的WordPress和子目录中的Django。

您必须在public_html目录中编辑.htaccess文件以正确重定向您的URL:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# Add the following line to exclude the /excluded_directory/ path
RewriteCond %{REQUEST_URI} !^/excluded_directory/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

此.Htaccess代码假设WordPress在基本目录中。如果是基本目录中的django,则将做相反的事情。

I was going through this and posted a question with the opposite issue having wordpress in the base directory and django in a sub directory.

You must edit the .htaccess file in the public_html directory to redirect your urls properly:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# Add the following line to exclude the /excluded_directory/ path
RewriteCond %{REQUEST_URI} !^/excluded_directory/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

This .htaccess code assumes wordpress is in the base directory. If it is django in the base directory then would do the opposite.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文