我没有任何访问控制面板工具的权限,也不知道如何正确操作。我创建了下面的重写规则来节省大量的工作--但是当我意识到服务器的微软的时候,这并不是很好。
RewriteRule ^scotsman-photo-products-([A-Za-z0-9-_]+)/?$ scotsman-photo-products.php?pg=$1
RewriteRule ^make-scotsman-photo-([A-Za-z0-9-_]+)/?$ make-scotsman-photo.php?pg=$1
似乎对配置文件所做的任何更改都会产生一个500错误--有没有可能服务器不允许任何更改,除非通过“官方”路由?
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
是当前的内容。
发布于 2013-03-01 08:37:29
<rewrite>
<rules>
<rule name="Rule Name" stopProcessing="true">
<match url="^scotsman-photo-products-([A-Za-z0-9-_]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{SCRIPT_NAME}" pattern="^/(files|images|js|css|robots.txt|sitemap.xml|favicon.ico)($|/.*$)" negate="true" />
</conditions>
<action type="Rewrite" url="scotsman-photo-products.php?pg={R:0}" />
</rule>
<rule name="Other Rule Name" stopProcessing="true">
<match url="^make-scotsman-photo-([A-Za-z0-9-_]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{SCRIPT_NAME}" pattern="^/(files|images|js|css|robots.txt|sitemap.xml|favicon.ico)($|/.*$)" negate="true" />
</conditions>
<action type="Rewrite" url="make-scotsman-photo.php?pg={R:0}" />
</rule>
</rules>
</rewrite>
我想这可能行得通。条件是可选的。
第一个条件规定,如果在该位置确实存在文件,则不使用该规则。第二个是类似的,如果它实际上是一个目录,它就会停止。如果URL是在模式中找到的类型,则第三个使规则不运行。
https://stackoverflow.com/questions/15148380
复制相似问题