簡體   English   中英

網址重寫執行重定向而不是源映射

[英]Url rewriting doing a redirect instead of a source mapping

我在服務器上安裝了一個wordpress,並將其放在apps / wordpress /文件夾下。

我想要做的使用TE url是化妝WordPress的可用http://mydomain.com/blog而不是網址http://mydomain.com/apps/wordpress

為此,我編寫了一個.htaccess文件,並將其放在服務器的根目錄中。 這是文件:

RewriteEngine    on
RewriteBase      /
RewriteRule      ^blog$    blog/  [PT]
RewriteRule      ^blog     /app/wordpress  [PT]

問題在於,瀏覽器沒有給我應用程序/ wordpress的內容,而是收到301,然后重定向到應用程序/ wordress。 我想做的是隱藏/ blog后面的apps / wordpress網址,而不進行重定向。

任何想法如何做到這一點?

嘗試改用Alias指令,該指令將是:

   Alias /blog   /<path to htdocs>/app/wordpress

好的,我不知道為什么,但這正在工作:

RewriteRule ^blog$ blog/
RewriteRule ^blog/(.*) /apps/wordpress/$1

沒關系,現在可以正常工作了:)

暫無
暫無

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

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