开发者

htaccess - remove page numeric ID

Is it possible to direct for a user to type in this URL

http://www.website.com/de/variable-page-name

and have this page show (but browser web address to remain as above URL)

http://www.website.com/de/123/variable-page-name

where 123 is a variable and can contain any number of digits where variable-page-name is a v开发者_如何转开发ariable and will have hyphens in

I'm a beginner at this and have tried to read examples but still can't figure it out. Your help is appreciated - thanks!


Where will the variable 123 come from? what is the variable input to compute 123?

you can do the following

RewriteRule de/(.+) de/123/$1

than de/somepage will be redirected to de/123/somepage.

In addition of course you can do redirects without htaccess on server side using php

header("Location: http://www.example.com/"); /* Redirect browser */


You can use mod_rewrite


You can try this rule: (it won't change the URL in the browser)

RewriteEngine On
RewriteRule ^/de/(.+)$ de/123/$1 [QSA,L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜