开发者

htaccess rewrite URL

开发者 https://www.devze.com 2023-02-07 05:32 出处:网络
If I have an URL that looks like the following, /iamawebpage.html can I rewrit开发者_运维知识库e to something like, iamnotawebpage?

If I have an URL that looks like the following,

/iamawebpage.html

can I rewrit开发者_运维知识库e to something like, iamnotawebpage?

basically change the whole URI.


Try this:

<IfModule mod_rewrite.c>
       RewriteEngine on
       RewriteBase /
       RewriteRule ^(.*)\.html$ $1
</IfModule>


This in .htaccess should work:

<IfModule mod_rewrite.c>
       RewriteEngine on
       RewriteRule ^(.*)\.html$ /$1 [R]
</IfModule>
0

精彩评论

暂无评论...
验证码 换一张
取 消