问题
I'm running into some problems with rewriting my URLs.
Recently moved to a new host where FollowSymLinks and SymLinksIfOwnersMatch is not allowed as options in my .htaccess file. Using these will give me a 500 error. Mod_rewrite is however enabled on the host.
Normally my rewriting code looks like the code below and works perfectly:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^link/(.*)$ link.php?urlkey=$1 [QSA]
But with removing +FollowSymLinks the rewriting doesn't work.
Any idea what I'm missing here?
Thanks in advance for your help.
EDIT
In the Apache docs (mod_rewrite - Appache HTTP Server Version 2.4) is stated that:
To enable the rewrite engine in this context, you need to set "RewriteEngine On" and "Options FollowSymLinks" must be enabled. If your administrator has disabled override of FollowSymLinks for a user's directory, then you cannot use the rewrite engine.
There must be a way to write pretty URLs even when FollowSymLinks is off right..?
来源:https://stackoverflow.com/questions/58063620/rewriterule-without-followsymlinks-or-symlinksifownersmatch