我希望能够在URL中输入以下内容:
https://mydomain.com/fork或https://mydomain.com/fork/
并将两者转到一个名为
但仍然只显示https://mydomain.com/fork (或者https://mydomain.com/fork/,不管怎样)
我希望index.html充当根,这样所有的图像urls等等都能工作(它们相对于‘/prod/叉_content/’)
当前,根目录中的.htaccess是:
ErrorDocument 404 /live/site_documents/document404.html
ErrorDocument 403 /live/site_documents/accessDenied.html
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^fork$ /fork/index.html [L,QSA]
RewriteRule ^fork/$ /fork/index.html [L,QSA]
RewriteRule ^fork/(.*)$ /prod/forklift_contents/$1 [L,QSA]有什么想法?
发布于 2011-06-09 05:26:59
您可以对可选的字符使用问号。
RewriteRule ^fork\/? /prod/fork/$1 [L]要获得一个非常好的重写教程,请查看本网站.htaccess提示和技巧..。
https://stackoverflow.com/questions/6288417
复制相似问题