How does. htaccess solve the website homepage url problems?

Source: Internet
Author: User
. How does htaccess solve the url issue of the website homepage. how does htaccess address the website homepage url? my website homepage has an address like this: my website domain name is tentatively set to & nbsp; A (www.a.com) and another website domain name is & nbsp; B (www. B .com) is now the first on my website. how does htaccess solve the website homepage url problem?
How does. htaccess solve the website homepage url problem?

The home page of my website has an address like this:
Tentatively set my website domain name to A (www.a.com)
Another website domain name is B (www. B .com)

At present, the home address of my website has /? From = B

How can I set. htaccess url rewriting to redirect the address to a normal state?

I wrote one myself:

RewriteRule ^ (.*)\? Www \. B \. com? $ Http://www.a.com/#1 [R = 301, L] but does not work
How should I set it?
------ Best solution --------------------
Http://www.localzend.com /? From = http://www.baidu.com

RewriteCond  %{REQUEST_URI} ^(.*)$
RewriteCond  %{QUERY_STRING} ^from=(.*)
RewriteRule ^(.*)$  a.php?a=%1 [L]

However, you need to set the header in a. php to redirect.


------ Other solutions --------------------
Reference:
Http://www.localzend.com /? From = http://www.baidu.com
PHP code

RewriteCond % {REQUEST_URI} ^ (. *) $
RewriteCond % {QUERY_STRING} ^ from = (.*)
RewriteRule ^ (. *) $ a. php? A = % 1 [L]


However, you need to use a. php header to redirect ......


Yes !!! Thank you !!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.