簡體   English   中英

htaccess重定向到另一個目錄

[英]htaccess to redirect to another directory

我有示例網站:

example.com

我在這個網站上有一個博客文件夾,我還有另一個文件夾,其中包含與根目錄完全相同的文件(其翻譯文件夾)

example.com/en/

我需要將點擊我的橫幅的用戶重定向到根博客文件夾,使用與他點擊的相同的屬性。

例如:

他點擊/ en /文件夾中的博客文章

example.com/en/blog/eventos_21_example-post

我需要在htaccess上添加一些內容來重定向此鏈接

example.com/blog/eventos_21_example-post

它需要是適用於每個帖子的東西。

有幫助嗎?

謝謝

將此代碼放在DOCUMENT_ROOT/.htaccess文件中:

RewriteEngine On
RewriteBase /

RewriteRule ^es/(blog/.*)$ /$1 [L,NC,R]
RewriteRule ^blog/(.*)$ /es/$1 [L,NC]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM