开发者

Redirecting using htaccess based on referrer

开发者 https://www.devze.com 2023-01-06 15:50 出处:网络
I开发者_如何学编程 want to redirect all the requests from a referrer folder. Here is the scenario.

I开发者_如何学编程 want to redirect all the requests from a referrer folder. Here is the scenario.

I want all the requests with referrer from http://www.example.com/demo/ex1/*.* to http://www.example.com/ex1/*.*

Help Please.

Thanks


You have that many subpages that you can't do this:

# Redirect old file path to new file path
Redirect /olddirectory/oldfile.html http://mt-example.com/newdirectory/newfile.html

or is for some specific reason?

if so, you can play a little with this and obtain your answer ;)

# To redirect all users to access the site WITHOUT the www. prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# adapt and uncomment the following:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.mt-example\.com$ [NC]
RewriteRule ^(.*)$ http://mt-example.com/$1 [L,R=301]

Just in case you are asking this is for the .htaccess

0

精彩评论

暂无评论...
验证码 换一张
取 消