Jump to content

301 redirect EXISTING page

Recommended Posts

Site URL: http://martindudekphoto.com

I want to redirect a page that exists in my squarespace account: /portfolio/uganda/
to another page that exists as well: /work/uganda/

That doesn't work, the redirect is being ignored and /portfolio/uganda/ shown as normal. Apparently I can only redirect not existing pages, what can I do to fix that?

Context: The reason is, I have 2 different portfolio pages: one with my whole portfolio (8 items) and one that I have as my home page (just 3 items), because I want to use the "hover: background" functionality, but not for the entire 8 items.

Screenshot 2020-11-22 at 23.07.58.png

Screenshot 2020-11-22 at 23.03.33.png

Edited by mtnddk
Link to comment
  • mtnddk changed the title to 301 redirect EXISTING page
4 hours ago, mtnddk said:

Thanks, @derricksrandomviews, but the one I am redirecting FROM is actually a portfolio item, which can not be deactivated (would be alright if it could), at least there is no such option in the portfolio item settings? Is there no possibility to do that?

You can deactivate the portfolio item if you remove it from the portfolio first. You should be able to drag it to the unlinked section of your site, then disable it. 

Link to comment

This is a tough one and it comes up often. This and bilingual sites with two domains, one to one "home" page and one to another, which can't be done unless you give out a sub domain which all pages have technically. Usually we tell folks to create a landing page, both main domains hit the page and then two action buttons direct the visitor to each page.  Hopefully you will get a better answer than that from the folks here. 

Edited by derricksrandomviews
Link to comment
  • 2 months later...
On 2/11/2021 at 10:53 PM, kickmouth said:

Hey @tuanphan - can you tell me more about the JavaScript redirect please

Thanks

Jason

Add to Page Header (page where you want to it redirect to new url)

<script>
         setTimeout(function(){
            window.location.href = 'https://beaverhero.com';
         }, 5000);
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 10 months later...
On 2/16/2021 at 3:50 AM, tuanphan said:

Add to Page Header (page where you want to it redirect to new url)

<script>
         setTimeout(function(){
            window.location.href = 'https://beaverhero.com';
         }, 5000);
</script>

 

I need to redirect a portfolio project (which doesn't have a code injection tab) to another portfolio. So that I can have a portfolio inside a portfolio.

 

Can I use this script but limit it to a specific page, for example: If page is X, then redirect to page Z

I can't use the URL mapping function because I have to have page X active.

Thank you in advance

Edited by zemaria
Link to comment
On 12/31/2021 at 7:54 AM, zemaria said:

@tuanphanI tried injecting the code you posted in a code block in the page, and it works, but not well at all. If I click on link to the page I want to redirect, it redirects to the one I want, but it flashes multiple times in the process.

If you need redirect immediately, use this new code

<script>
            window.location.href = 'https://beaverhero.com';
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
  • 2 weeks later...

I would also like to be able to instantly redirect a page that exists in my top-level navigation. It's there now if you'd like to see what I'm trying to do.

Right now I have Discord pointing to a page that has our Discord server embedded in a pageI don't like how it's functioning, so I'd rather just redirect visitors to the web page access to our server.
How can I do that?

Edited by alleinedragonfyre
forgot to add link to example
Link to comment
On 1/1/2022 at 4:00 AM, tuanphan said:

If you need redirect immediately, use this new code

<script>
            window.location.href = 'https://beaverhero.com';
</script>

 

Hi Tuan,

I've found your code to be very useful to link from my Forte 7.0 homepage collection titles to the  related project pages (website: www.gabrielefranchini.it PW: gf2021 ), there is only a little issue working on Squarespace: once you've set the code in the advanced > page injection code section using your owned external domain, if then you click on the page in the left Squarespace column, it has some problem and turns white as shown in the bottom video. It happens only using an external domain as shown, if you use the "Squarespace default URL" it doesn't have any problem, but once someone click on the collection title, then he goes to the default squarespace URL instead of your domain.

Is there any way to set your code with just the last part of the directory? Like '/projects/924' omitting the domain part so that it doesn't give problems managing Squarespace, and also doesn't send you out of the correct owned URL? Thank you!

Link to comment
  • 1 month later...
9 hours ago, Lauren_C said:

Hello Tuan, 

I have the same problem as the person above. 

The code has broken the Squarespace backend editor of our site. How can I access the page to disable the script? 

Hi Lauren, I don’t know how to modify the code to solve the problem, but I also had your same issue: it happened since you probably injected that code in the home page settings.

The solution I used, was to go on the Squarespace mobile app, add a page to my website, chose it to be the new home page, and then the Squarespace editor will works again properly. At that point, remove the custom code you added to the original home page, set it once again as home page, and remove the page you added to unlock it all. Done.

I think the whole thing happened because we used our custom domain as redirected URL, so as you access the Squarespace editor, it’s like it’s immediately redirected outside of itself. That code is perfect, but it can’t be used in the home page CSS. 
 

If Tuan have another solution, modifing the code, I’m still interested too.

Cheers.

Link to comment
10 hours ago, Lauren_C said:

How can I access the page to disable the script? 

You can put your site into a "safe mode" that prevents custom scripts from loading by adding "/config/safe" to you site's URL. For example:

1439036231_Screenshot2022-02-24at09_29_25.thumb.png.334074b680a07b3118b33123dafc0c12.png

Once you have removed the script (and saved the changes), you can load your site normally.

This is one of the URL paths and URL queries I describe in this article: Squarespace URL Queries.

Did this help? Please give feedback by clicking an icon below  ⬇️

About: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.
If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.