urls - How to redirect to clean links with this code

I have a website uses wildcard*i made a custom page called custom-page.phpi used this code to access to this custom page

I have a website uses wildcard*

i made a custom page called custom-page.php

i used this code to access to this custom page

RewriteCond %{THE_REQUEST} \h/custom-page\h
RewriteCond %{REQUEST_URI} !^/custom-page\.php
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\$
RewriteRule ^ x.php?id=%1 [L]

My problem :

this code makes this url :

subdomain.domain/custom-page

works fine and access my custom-page.php

but also when you type

subdomain.domain/custom-page.php?id=subdomain

it access too

What i Need :

what i need is when user enters this url

subdomain.domain/custom-page.php?id=subdomain

it automatics redirect him to

subdomain.domain/custom-page

how can i modify this code

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744923446a4601281.html

相关推荐

  • urls - How to redirect to clean links with this code

    I have a website uses wildcard*i made a custom page called custom-page.phpi used this code to access to this custom page

    1天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信