Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在表单的网页上有一个项目列表:
www.mydomain.com/item1-EUR.html
www.mydomain.com/item1-GBP.html
www.mydomain.com/item2-EUR.html
www.mydomain.com/item2-GBP.html
是否可以访问以下网页文件:
/myitems/eur/item1-EUR.html, 或者/myitems/gbp/item1-GBP.html
/myitems/eur/item1-EUR.html
/myitems/gbp/item1-GBP.html
我试图表明项目网页位于根目录中,但不会弄乱根区域。
尝试在文档根目录的 htaccess 文件中添加这些规则(最好高于您可能已经拥有的任何规则):
RewriteEngine On RewriteRule ^([^-]+)-EUR\.html$ /myitems/eur/$1-EUR.html [L] RewriteRule ^([^-]+)-GBP\.html$ /myitems/gbp/$1-GBP.html [L]