0

I've got:

RewriteRule ^([a-z0-9-_]+)/$ index.html
RewriteRule ^([a-z0-9-_]+)$ index.html

and it works fine, when I request i.e.:

localhost/library/contact

but crashes, when attempted to request the same URL, but with slash at the end - the file loads, but with no styles, scripts etc.

I figured it's because I haven't got absolute pathes to every image and script in the document.

Is there a way to get the url with slash at the end to work just like if it wasn't there?

4

1 回答 1

0

是的,使用 ? 使斜线可选

RewriteRule ^([a-z0-9-_]+)/?$ index.html
于 2013-09-27T14:10:57.460 回答