开发者

mod_rewrite rewrite_rule syntax question

开发者 https://www.devze.com 2022-12-20 21:11 出处:网络
I have the following in my .htaccess currently- <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^go/([^/]*)/([0-9]+)/([0-9]+)/?$ http://foo.com/wp-content/plugins/foo/cloak.php?post_id=$2

I have the following in my .htaccess currently-

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^go/([^/]*)/([0-9]+)/([0-9]+)/?$ http://foo.com/wp-content/plugins/foo/cloak.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
RewriteRule ^go/([^/]+)[/]?$ http://foo.com/wp-content/plugins/foo/cloak.php?name=$1&cloaked_url=$0 [L]
</IfModule>

I want to change it so that the domain 'http://foo.com' is auto-detected and inserted (or just left off if it's unnecessary.

I'm hoping to use this .htaccess to manage multiple mapped domains to the same code base and can't really have it work w开发者_StackOverflowith a specific URI in there.


Use RewriteCond for that:

RewriteCond %{HTTP_HOST} !^foo.com$
RewriteRule ...
0

精彩评论

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