0

I need clean urls (e.g. example.com/test) to redirect all requests without a file extension to html pages (so I can still call programmed pages without rewriting). I made a file that I hoped should do this, but it doesn't :/ Any ideas?

Here is my current .htaccess file:

RewriteEngine On    # Turn on the rewriting engine
RewriteRule  ^([^/.]+)/?$ $1.html [L]
4

2 に答える 2

1

これを試してみてください。RewriteCond(ition) を設定する必要があります。それ以外の場合は、無限ループがあります...

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^([^/]+)$ $1.html 
于 2012-05-16T16:09:23.303 に答える
0

この行を上に配置してみてください。

Options +FollowSymlinks
于 2012-05-16T16:07:09.127 に答える