1

I have looked online for a solution here but I am struggling to find the right answer. Hopefully someone can help.

I have the following translation link on a webpage like so, <a href="/de/about/">Translate</a> but the actual path was on my server is /_translations/de/about/.

Currently, the link goes to a 404 error and of course works if I prepend the url to the actual path.

What would be the rewrite rule for this?

4

1 に答える 1

0

ドキュメント ルートの htaccess ファイルに次のルールを追加してみてください。

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z]{2})/(.*)$ /_translations/$1/$2 [L]
于 2013-04-24T19:27:51.593 に答える