Ad

How Redirect From Url To The Part Of This Url .htaccess

- 1 answer

Can you, please, tell how to make a redirect with apache .htaccess:

fromhttp://www.domain1.com/products/?http://www.domain2.com/sdssds?%dfdf

tohttp://www.domain2.com/sdssds?%dfdf

Ad

Answer

Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+products/\?([^\s]+) [NC]
RewriteRule ^ %1 [L,R=302,NE]
Ad
source: stackoverflow.com
Ad