English 中文(简体)
如何做htaccess modrewrite重定向url?
原标题:How to do a htaccess modrewrite for redirecting a url?

有一个紧急问题,我完全被难住了。

我们最近迁移了一堆网络博客,并意识到其中一个使用了子文件夹结构,而所有的新系统都是子域。wordpress多站点系统不允许同时使用子域和子文件夹结构,所以我猜合理的解决方案是使用htaccess将旧url的请求重定向到新url。但是我该如何在htaccess中编写代码呢?

I need to make all requests to http://www.mysite.com/720/etcetc to http://blog.mysite.com/etcetc

这有可能吗?或者还有其他更可行的解决方案吗?

非常感谢您的协助。

提前谢谢。

最佳回答

我的建议是安装上运行的任何站点上的重定向插件http://www.mysite.com/并让它动态地将所有请求重定向到/720/etcetc/*的新地址。重定向可以添加适当的HTTP301标头,而且由于它是动态执行的,因此您不需要查找每个URL来编写.htaccess文件。

问题回答

暂无回答




相关问题
Ignore symlinks in clean URL s in .htaccess

Example URL: example.com/user /user is both a symlinked directory and a valid URL to content on my site. I user Horde Routes to request the content and all requests to the site go through index.php. ...

.htaccess File Options -Indexes on Subdirectories

I have the following .htaccess line, simple no indexes on root. Options -Indexes What do we add so it propagates to any sub directory instead of having to create one file for each? One .htaccess on ...

Mod Rewrite ignoring -d

After a day or two, I am still fighting with Mod Rewrite. It seems that 60% of my development time is spent battling the server. My current URL structure is such that all http://example.com/xyz and ...

ErrorDocument 404 Not Sending Referrer Information: PHP

I m using a standard htaccess ErrorDocument 404 to redirect users to a new page. In order to customize the 404, I need to know their referrer information (from the page they Tried to visit). $...

Find all htaccess files on server [closed]

I m looking for a Linux command to go through all the directories on my server and find all .htaccess files. The output would be a list of all those files with full path, creation/modification date ...

301 Redirect Help with Dynamic URL s and Multiple Id s

I just did a redesign for www.wildchildclothes.com which has a new URL structure. The old site ran on Zen Cart and had a bad URL structure. Here are some examples of what I want to redirect from: OLD:...

热门标签