RewriteRule without FollowSymLinks or SymLinksIfOwnersMatch

落花浮王杯 提交于 2021-02-08 06:37:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!