English 中文(简体)
• 如何动态地改变一字塔,而不实行ur升统治
原标题:How to change a wordpress post url dynamically without url re-write rule

我有<代码>postURL,其中基本上包含一个字句。 页: 1

$postURL = get_permalink($postID);

如今,这笔钱已经到位。 URL是:

http://www.blogname.come/post-permalink/

我想要改变这种状况。

http://www.blogname.come/post-permalink-1/

i.e. 在定购单末尾添加-1,并添加到一个新的变量$newURL上。

// Function to include required JS and CSS in header function wplikelockercss() {

// Include the CSS
echo "<link type="text/css" rel="stylesheet" href="".get_bloginfo( wpurl )."/wp-content/plugins/".basename(dirname(__FILE__))."/like-locker.css"> 
";
//$postID = $_POST[ post ];
$postID = get_the_ID();
$postURL = get_permalink($postID);
新增加的URL=亚斯特(邮资0-1)。 “-1”
//新URL=“1-”。


// Echo our per page post ID callback from facebok, when the user clicks like this function will be triggerd and their IP will be stored in the databse with the post ID
echo "
<script type="text/javascript">

    FB.Event.subscribe( edge.create , function(href){ 

        var data = { post:  ".get_the_ID()." , action:  fbjax  iii;

        jQuery.post( ".admin_url(  admin-ajax.php  )." , data, function(response) {

            //location.reload();
            //location.href= http://www.blogname.net/how-thing-work-1 ;
            location.href= $newURL ;

        iii);

    iii);

</script> 

";

iii

上文提供了我已经制定的法典。 我正在拿到电费,取出电费,然后试图创建新的URL。 地点.href 然后使用这一新美元,将用户转往新网页。

然而,如果使用的话

新增加的URL=亚斯特(邮资0-1)。 “-1”

新员额

http://www.blogname.net/e-1 or someother character before -1

一、使用

新URL=“1-”。

地点:

http://www.blogname.net/1-

问题回答

Using htaccess, host Linux:

RewriteEngine On    
RewriteBase /
RewriteRule post-permalink-1$ post-permalink

$newUrl = substr($postUrl, 0 -1) ;<-1/>;





相关问题
URL rewrite in IIS6 - Third party tools

I have collected the following api/sdk/whatever which provide modules for doing url rewriting in IIS 5/6/7. Some are free-open source and some require $. I haven t tried any of them. I would like to ...

Rewrite spring-security redirect URLs

I m trying to get Tuckey UrlRewriteFilter to tidy up URLs for my webapp. One problem I ve got is that when spring-security notices that an anonymous user is trying to access a protected resource it ...

ASP.NET Friendly URLs

In my research, I found 2 ways to do them. Both required modifications to the Application_BeginRequest procedure in the Global.Asax, where you would run your code to do the actual URL mapping (mine ...

Could I get by HttpModule the URL that contains * before?

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address And I would support *...

Domains & Foreward Slash

This is rather difficult to explain so please bear with me. We will be hosting 4 websites on our server and the plan is to have each site sit under its own domain: site-a.com site-b.com sub1.site-b....

URL Mod-Rewrite

I currently have a working URL: http://example.com/security-services.php?service=fixed-camera-surveillance and then I have PHP say, $_REQUEST[ service ] to do some stuff... But I d like to ...

热门标签