Discussion for doc: Advanced Redirects and Restrictions

Advanced Redirects and Restrictions

I have one page that refuses to redirect to the right page.

Using the code in the documentation above we moved adaptflorida to jaxtoday/adapt. I have it all going to the right place in it’s new home, except for adaptflorida/about. Instead of going to jaxtoday/adapt/about it goes to jaxtoday dot org/about.

I’ve done this a few times before on other sites. For example, jaxmusic redirects to wjct/jaxmusic. And jaxmusic/about has no problems redirecting to wjct/jaxmusic/about.

As far as I can tell, I have set up everything correctly. What is going on?!

Sorry about the lack of URLs. The forum wouldn’t let me put in more than one .org in the post. All of our domains are .org.

1 Like

Thanks for popping in @RayHollister! I am sorry to hear you are having issues here. I am going to tag some of our wonderful technical writers/doc gurus to see if someone can help here.

@edwardangert @joan.edwards @michalsen @audrac any thoughts here? :slight_smile:

1 Like

I got it! It was a stupid typo on my part! I left the forward slash at the end of the folder name:

$newurl = 'https://jaxtoday.org/adapt/'. $_SERVER['REQUEST_URI'];
$newurl = 'https://jaxtoday.org/adapt'. $_SERVER['REQUEST_URI'];


it’s a slash that’ll get you :slight_smile:


thanks for checking back in with your solution, @RayHollister !

Seems like something others might get stuck on as well.

Looking at the doc, in the Redirect from Subdomain to Subdirectory Path section, it says:

The following configuration will redirect requests for subdomain.example.com to https://example.com/subdirectory/ .

Do you think it’d be helpful if we:

  1. remove the trailing / from the example URL
  2. add a note to say something like, “don’t use a trailing / unless you want to [something - I’d have to get that info]”
1 Like