我正在努力为最初使用查询字符串构建的网站创建适当的301重定向.旧的URL结构如下所示:
http://www.oldsite.com/about/index.cfm?fuseaction=cor_av&artID=5049
Run Code Online (Sandbox Code Playgroud)
我想将整个子文件夹(名为"about")重定向到新域上的新页面.新域名的URL如下所示:
http://www.newsite.com/info
Run Code Online (Sandbox Code Playgroud)
所以,我设置了一个如下所示的重定向:
redirectMatch 301 ^/about/ http://www.newsite.com/info
Run Code Online (Sandbox Code Playgroud)
它重定向很好,但它保持附加原始URL字符串,因此新的URL在浏览器中看起来像这样:
http://www.newsite.com/info/?fuseaction=cor_av&artID=5049
Run Code Online (Sandbox Code Playgroud)
我绝对不够Apache/301专家知道如何解决这个问题.我只是想剥掉一切从?上.
真的很感激任何帮助.
这是我希望的一个快速问题......
我正在尝试设置一个可在全站范围内使用的cookie.我正在创建一个潜在客户型网站.我希望用户填写表单以访问独家信息.一旦他们填写表格,他们就可以访问信息.
我在用户提交表单时丢弃一个cookie,这样他们就可以在下次访问网站时直接访问内容.他们填写的表格位于网站每个页面的侧边栏中.当用户在一个页面上填写表单时,他们不应该在网站的任何页面上看到它.
一切都在运作,除了全站点位.我认为问题在于这段代码:
function set_cookie(name, value, expires, path, domain, secure){
if (!expires){expires = new Date()}
document.cookie = name + "=" + escape(value) +
((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
((secure == null) ? "" : "; secure");
}
Run Code Online (Sandbox Code Playgroud)
但这是下面的完整代码.非常感谢!
<script type="text/javascript">
<!--
cookie_name="landasp"
expdays=365
// An adaptation of Dorcht's cookie functions.
function …Run Code Online (Sandbox Code Playgroud) 我正在使用WordPress帖子的jQuery Isotope插件.我想在页面加载时显示帖子摘录,然后通过简单地扩展div的高度来显示点击的整个帖子.但是,Isotope插件会在用户单击"Read More"按钮以展开页面之前计算div高度,因此新高度会破坏插件.
我正在玩reLayout方法,但还没有想出来......任何想法?
这是一个有效的链接.尝试"草莓"帖子.http://ashlinixon.com/new-test/index.html
此外,代码示例:
HTML:
<article class="item">
<div class="featured-img"><img src="images/strawberries.jpg" alt="Strawberries" /></div>
<h2>Strawberries</h2>
<p class="excerpt">Lorem ipsum dolor sit amet</p>
<p class="read-more">Read more</p>
<div class="post">
test test<br />test test<br />test test
</div>
</article>
Run Code Online (Sandbox Code Playgroud)
jQuery的:
$(document).ready(function(){
$(".post").hide();
$(".excerpt").show();
$('.read-more').click(function(){
$(".post").slideToggle();
$("#portfolio").isotope( 'reLayout' );
});
});
Run Code Online (Sandbox Code Playgroud)
谢谢!:)
我正在一个网站上工作,我正在显示与当前类别相关的所有子类别的列表.下面的代码可以正常工作,但我想改变子类别列表的排序方式.目前,它按类别ID排序.我希望它以Magento用户在管理员中放置类别的任何顺序显示(他们可以通过拖放来更改类别顺序).感谢任何帮助!
<?php
$currentCat = Mage::registry('current_category');
if ( $currentCat->getParentId() == Mage::app()->getStore()->getRootCategoryId() )
{
// current category is a toplevel category
$loadCategory = $currentCat;
}
else
{
// current category is a sub-(or subsub-, etc...)category of a toplevel category
// load the parent category of the current category
$loadCategory = Mage::getModel('catalog/category')->load($currentCat->getParentId());
}
$subCategories = explode(',', $loadCategory->getChildren());
foreach ( $subCategories as $subCategoryId )
{
$cat = Mage::getModel('catalog/category')->load($subCategoryId);
if($cat->getIsActive())
{
echo '<a href="'.$cat->getURL().'">'.$cat->getName().'</a>';
}
}
?>
Run Code Online (Sandbox Code Playgroud) apache ×1
cookies ×1
javascript ×1
jquery ×1
magento ×1
query-string ×1
redirect ×1
setcookie ×1