如果AbstractCollection
不存在,是否可以(假设使用.htaccess?)自动将ArrayList
重定向到public String toString() {
Iterator<E> it = iterator();
if (! it.hasNext())
return "[]";
StringBuilder sb = new StringBuilder();
sb.append('[');
for (;;) {
E e = it.next();
sb.append(e == this ? "(this Collection)" : e); // here self calls are prevented
if (! it.hasNext())
return sb.append(']').toString();
sb.append(',').append(' ');
}
}
?
但如果有blah.com/hello
,我仍然希望在没有重定向的情况下显示。
答案 0 :(得分:1)
尝试:
RewriteEngine on
#if /foo/index.php is not a file
RewriteCond %{REQUEST_FILENAME}\.index.php !-f
#then redirect /foo to /foo.php
RewriteRule ^([^./]+)/?$ /$1.php [NC,L,R]