htaccess中的重定向不起作用

时间:2018-08-22 17:47:58

标签: apache redirect mod-rewrite url-rewriting

这是我的.htaccess。对于section.php上的系统生成网址,此操作正常。但是,当我为article.php,product.php,page.php,contact.php添加额外的行时,它不起作用。有关添加多个mod重写的任何想法。 https://www.lortolan.com/

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.co.uk [NC] 
RewriteRule ^(.*)$ http://www.xampleco.uk/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ 
RewriteRule ^index\.php$ http://www.xample.co.uk/ [R=301,L] 

RewriteEngine On 
 RewriteBase /

# Redirect .php URLs to rewritten URLs
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.+)\.php$ $1 [L,QSA,R=301]

# Rewrite URLs for processing by router (section.php)
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.+)$ section.php?url=$1 [QSA,L,NC]

# These are working
Redirect 301 /files/example.pdf https://www.lortolan.com/
Redirect 301 /section.php/11/1/restaurant-reading https://www.lortolan.com/

这是可行的,但是将URL的痕迹留在了重定向上,好的,但是很干净是很高兴的

https://www.lortolan.com/

0 个答案:

没有答案