对于一个新的爱好网站,我直接调用子目录时遇到问题。
当您转到http://www.placewomen.com/222/222/image.jpg时 ,图像会直接加载。 但是当你转到http://www.placewomen.com/222/222/我有一个提交错误,因为没有index.html / php来显示图像(我也不想要那里......! )。
我想要发生的是当调用子目录时,页面显示为image.jpg。 子文件夹是动态生成的。
我自己是一名前端开发人员,通过htaccess实现这一目标的知识对我来说是“有点”......
任何帮助都非常感谢! 问候克里斯
For a new, hobby, website I have a problem when a subdirectory is called directly.
When you goto http://www.placewomen.com/222/222/image.jpg the image is loaded directly. But when you goto http://www.placewomen.com/222/222/ I've got a premission error because there is no index.html/php to show image (which I also don't want there...!).
What I would like to happen is when subdirectory is called the page is shown with the image.jpg. The subfolders are generated dynamicaly.
I'm a frontend developer myself and the knowledge to make this happen through the htaccess is "a bit" to much for me....
Any help is highly appreciated! greetings Chris
最满意答案
尝试将此添加到文档根目录中的htaccess文件:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME}/image.jpg -f RewriteRule ^(.*)$ /$1/image.jpg [L]Try adding this to the htaccess file in your document root:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_FILENAME}/image.jpg -f RewriteRule ^(.*)$ /$1/image.jpg [L]更多推荐
发布评论