如何重写
website.com/feed/file.xml
到
website.com/feed
使用htaccess?
我需要用户访问第一行并向他显示第2行的内容。
编辑1:已发布当前.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^feed?$ feed/sejururi.xml [NC,L]
</IfModule>
答案 0 :(得分:1)
I need the user to access first line and show him the content from 2'nd line.
此规则适合您DOCUMENT_ROOT/.htaccess
文件:
RewriteEngine On
RewriteRule ^(feed)/sejururi\.xml$ /$1 [NC,L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(feed)/sejururi\.xml$ $1 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
答案 1 :(得分:0)
尝试:
RewriteEngine On
RewriteRule ^feed?$ feed/file.xml [NC,L]