重写规则到重写规则?
我想将一个 RewriteRule 写入另一个 RewriteRule,但我似乎无法让事情正常工作。 行感到麻烦
RewriteRule ^(eTool/)?(RENDER/\d+/\d+/\d+/\d+\.html)$ render-product?url=$2 [L,NC]
我对这个文件中的
RewriteEngine On
RewriteBase /
RewriteRule ^(eTool/)?(RENDER/\d+/\d+/\d+/\d+\.html)$ render-product?url=$2 [L,NC]
#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
:基本上,url render-product 是由 wordpress 创建的 url frendly url。我希望像 ?url=RENDER/34324/4234/234234.html 这样的东西可以通过 $_GET['url'] 在 WordPress 页面 render-product 上访问。
我做错了什么?
I want to write a RewriteRule to another RewriteRule, but I can't seem to get things to work. I'm having troubel with the line
RewriteRule ^(eTool/)?(RENDER/\d+/\d+/\d+/\d+\.html)$ render-product?url=$2 [L,NC]
in this file:
RewriteEngine On
RewriteBase /
RewriteRule ^(eTool/)?(RENDER/\d+/\d+/\d+/\d+\.html)$ render-product?url=$2 [L,NC]
#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
Basically, the url render-product is a url frendly url created by wordpress. I want something like ?url=RENDER/34324/4234/234234.html to be accessible on the wordpress page render-product via $_GET['url'].
What am i doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议将 URL 重写为 WP 作为查询参数,因为 WP 不会解析重写 URL 的永久链接,它只会检查原始 URI 请求(如果这有意义!?)。
I've suggested rewriting the URL to WP as query parameters, since WP won't parse the permalink of the rewrited URL, it will only examine the original URI request (if that makes sense!?).