2016-08-23 16 views

回答

1

裏面long/.htaccess您可以使用此規則:

RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([\w-]+)/?$ long.php?l=$1 [L,QSA] 
0

放入長目錄此.htaccess文件。

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.+)\.html$ long.php?l=%{REQUEST_URI} [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.+)\.pdf$ long.php?l=%{REQUEST_URI} [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.+)\.cvs$ long.php?l=%{REQUEST_URI} [L,QSA] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.+)\.xml$ long.php?l=%{REQUEST_URI} [L,QSA] 
</IfModule> 
## EXPIRES CACHING ## 
<FilesMatch "\.(jpg|jpeg|png|gif|swf|woff)$"> 
Header set Cache-Control "max-age=604800, public" 
</FilesMatch> 
<FilesMatch "\.(css|js)$"> 
Header set Cache-Control "max-age=604800, public" 
</FilesMatch>