Php 为什么我的链接没有被缩短?
我正试图缩短我的链接,使它们变得漂亮,正如你在我的.htaccess代码中看到的那样,但出于某种原因,它没有听它们。为什么它不起作用Php 为什么我的链接没有被缩短?,php,apache,.htaccess,mod-rewrite,url-rewriting,Php,Apache,.htaccess,Mod Rewrite,Url Rewriting,我正试图缩短我的链接,使它们变得漂亮,正如你在我的.htaccess代码中看到的那样,但出于某种原因,它没有听它们。为什么它不起作用 Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.migrus.mi-g\.us RewriteRule ^(.*)$ $1?lang=rus [QSA,L] RewriteRule ^home1/ home1/home1.php
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.migrus.mi-g\.us
RewriteRule ^(.*)$ $1?lang=rus [QSA,L]
RewriteRule ^home1/ home1/home1.php [NC]
RewriteRule ^home2/ home2/home2.php [NC]
RewriteRule ^home3/ home3/home3.php [NC]
RewriteRule ^certificates/([A-Za-z0-9-]+)/?$ certificates/certificate.php?cert_clean_url=$1 [QSA]
RewriteRule ^order-form/?$ order-form/order-form.php [QSA]
RewriteRule ^about/ about/about.php [NC]
RewriteRule ^site-map/?$ site-map/site-map.php [QSA]
RewriteRule ^contact/ contact/contact.php [NC]
RewriteRule ^blog/ blog/blog.php [NC]
RewriteRule ^blog-single/([A-Za-z0-9-]+)/?$ blog-single/blog-single.php?post_clean_url=$1 [QSA]
ErrorDocument 404 /404.php
问题是,如果没有重写条件,您的重写规则将在第一次执行时得到满足。每个规则都需要一个条件。您丢失了
$
比如RewriteRule^home1/home1/home1.php[NC]
应该是RewriteRule^home1/$home1/home1.php[NC]
谢谢,我刚刚添加了$。只是看不见而听不见。您在浏览器中输入的URL是什么?您希望看到内容的URL是什么?原始URL应该是http://migrus.mi-g.us/home1.php
我只希望它被重写为http://migrus.mi-g.us/home1