About Apache's .htaccess issue
阿神
阿神 2017-05-16 17:00:24
0
1
596

Hello everyone! My current requirement is: When the entered URL address is http://www.lazyer.com/lazyer/frontend/web/site/login, force the redirection to http://www.lazyer.com/site/login . For this purpose, I wrote a .htaccess file in the server root directory. The code inside is as follows:

<IfModule mod_rewrite.c>
    RewriteEngine On 
    RewriteBase / 

    RewriteCond %{HTTP_HOST} ^www\.lazyer\.com$
    RewriteCond %{REQUEST_URI} ^/lazyer/frontend/web/
    RewriteRule ^lazyer/frontend/web/(.*)$ http://www.lazyer.com/ [L,R=301]

</IfModule>

apache has also enabled the rewrite function, but when entering http://www.lazyer.com/lazyer/frontend/web/site/login, there is no redirection effect. What's going on?

阿神
阿神

闭关修行中......

reply all(1)
漂亮男人

The first letter of Lazyer in your URL is capitalized, right? The rule is to write less.

It is recommended that you first write an absolutely matching rule to verify whether the configuration is valid. Such as:
RewriteRule .* http:://segmentfault.com [R,NC]

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template