Apache HTACCESS-应用一些简单的mod_重写规则

Apache HTACCESS-应用一些简单的mod_重写规则,apache,.htaccess,mod-rewrite,url-rewriting,Apache,.htaccess,Mod Rewrite,Url Rewriting,这很紧急。我需要一些访问规则方面的帮助。线索是,当用户收到某事物的答案时,真正的url将是www.mydomain.com/results.html/sth,但他必须只能在浏览器中看到www.mydomain.com/sth,当我将他重定向到主页(www.mydomain.com/index.html)时,url只能是www.mydomain.com 谢谢将前3行代码替换为: DirectoryIndex index.html 默认情况下,它应该可以工作,但这应该可以工作: RewriteEn

这很紧急。我需要一些访问规则方面的帮助。线索是,当用户收到某事物的答案时,真正的url将是www.mydomain.com/results.html/sth,但他必须只能在浏览器中看到www.mydomain.com/sth,当我将他重定向到主页(www.mydomain.com/index.html)时,url只能是www.mydomain.com


谢谢

将前3行代码替换为:

DirectoryIndex index.html
默认情况下,它应该可以工作,但这应该可以工作:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(results|index)\.html
RewriteCond %{REQUEST_URI} !^/?$
RewriteRule ^(.*)$ /results.html/$1

RewriteRule ^index\.html$ / [R=301,L]

非常感谢。这适用于results.html,但不幸的是不适用于homepage index.html。链接到www.mydomain.com/index.html或www.mydomain.com/会将我带到www.mydomain.com/index.html或www.mydomain.com/,但会显示www.mydomain.com/results.html的内容。仍然与我之前描述的内容不同。指向www.mydomain.com/的链接将我带到那里,但不幸的是内容来自www.mydomain.com/results.html。您尝试过我下面的建议吗?
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(results|index)\.html
RewriteCond %{REQUEST_URI} !^/?$
RewriteRule ^(.*)$ /results.html/$1

RewriteRule ^index\.html$ / [R=301,L]