可以URL重写后没有网站地图重写、地图、网站、URL

2023-09-02 01:07:17 作者:念及你好

我已经写在.htaccess文件中重写规则,我的网站页面:

I have written a rewrite rule in the .htaccess file for my website page:

RewriteRule ^nice_url/$  ?p_action=user_profile&post_author=45 [L]

完整的链接是: http://www.example.co.il/nice_url/ 它完美的作品。

但是,当我尝试创建一个站点地图(例如使用 HTTP://www.web-site -map.com/ ),我有一个迹象表明链接 HTTP:// WWW .example.co.il / nice_url / 被打破了。

BUT, when I try to create a sitemap (e.g. with http://www.web-site-map.com/), I have an indication that the link "http://www.example.co.il/nice_url/" is broken.

为什么呢?

链接工作正常。为什么它表示为坏了?

The link is working fine. Why is it indicated as broken?

谢谢!

推荐答案

看来,我发现这个问题:

Seems that I found the problem:

我有一个重定向到3个不同的文件夹中的主.htaccess文件。每个文件夹是一个不同的网站(都在同一个主机)。

I have a main .htaccess file that redirects to 3 different folders. Each folder is for a different website (all in the same host).

其中一个网站在WP。重写情况良好。

One of the websites is in WP. The rewrite happens well.

但是,当我尝试生成网站地图 - 可湿性粉剂返回一个404的站点地图生成器而这就是为什么我得到一个错误

BUT, when I try to generate a sitemap - the wp returns a 404 for the sitemap generator and thats why I get an error.

解决方案:我可能会尝试从PHP的,而不是从htaccess的重写

solution: I'll probably try to rewrite from the php and not from the htaccess.