我需要在文件扩展名
之后直接进行操作 http://www.your-name.dk/Whatever-url.php-Whatever 301
- > http://www.your-name.dk/Whatever.php
我试过这个但没有工作
RedirectMatch permanent (.*).php.* htt*://www.your-name.dk/$1.php
答案 0 :(得分:1)
启用mod_rewrite和.htacess,然后在DOCUMENT_ROOT下的.htaccess中添加此代码:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^([^-]+)-[^.]+\.php-\1$ $1.php [L,NC,R=301]