HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Another redirect question

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#74246 (In Topic #15457)
Avatar

Community saint

I decided to change some of my forum structure. I thought I did it before Google started crawling, but no, things were already crawled and I am now getting crawl errors. Can I do a redirect from one sub-forum to another sub-foum using the redirect feature in ocPortal?

Assuming it can be done, what would the redirect look like (using short URLs) going from

Code

http://www.domain.com/forum/forumview/misc/stories-about-julian-/california-1966-to.htm

to

Code

http://www.domain.com/forum/forumview/misc/stories-about-julian-/

Thanks for any help.

Bob
Back to the top
 
Posted
Rating:
#74384
Avatar

Community saint

Has anyone at all had any success using the built-in redirects? Is it possible to address the above scenario using the built-in redirects (basically, redirecting an a no longer existing sub-forum to its parent forum)?

I think I've tried every combination but can't seem to get it to work? Do you need to use the numberIDs for this to work or does it would with short URLs/URL monikers?

Bob
Back to the top
 
Posted
Rating:
#74386
Avatar

ocPortal redirects are purely for between zones/pages, nothing deeper.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#74434
Avatar

Community saint

Chris-

That's why I am confused. I thought I am just redirecting from one page (/forum/forumview/misc/stories-about-julian-/california-1966
-to.htm) to another (/forum/forumview/misc/stories-about-julian-.htm)

Is that not possible?

Bob
Back to the top
 
Posted
Rating:
#74450
Avatar

I mean an ocPortal page. 'forumview' is a page in ocPortal, as are Comcode Pages.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#74508
Avatar

Community saint

Gotcha. Sad it can't redirect URLs. I just figured it could because the commerce software I used supported this.

Bob
Back to the top
 
Posted
Rating:
#75523
Avatar

Community saint

Well, I truly thought I had finally figured this out but it seems the regex gods don't agree.

I have some former URLs with that all look like this:

Code

http://www.julianrittercentral.com/forum/forumview/misc/stories-about-julian-/world-war-ii.htm

I want to redirect these URLs to this:

Code

http://www.julianrittercentral.com/forum/forumview/misc/stories-about-julian-.htm

So I studied the reges stuff and came up with this to include within the  Rewrite block in .htaccess:

Code

RewriteRule ^/stories-about-julian-/?$   /stories-about-julian-.htm [NC,L,R=301]    #Rewrite old URLs to parent directory

My understanding was as follows:
^ - whatever the string is before what follows
?$ - all the characters till the end of the string

NC - case insensitive
L - don't process any rules after this
#=301 - this is a permanent redirect

I also tried using the following which didn't work any better:

Code

/forum/forumview/misc/stories-about-julian-/world-war-ii.htm

The good news is I didn't get 500 errors as a result of my effort. The bad news is I didn't get redirected to the substituted page and I still get the 404 error.

Can any kind soul explain to me the error of my ways?

Thanks for any help.

Bob
Back to the top
 
Posted
Rating:
#75524
Avatar

Community saint

I think this might be what you are after:

Code

RewriteRule ^(.*)/stories-about-julian-/ $1/stories-about-julian-.htm  [NC,L,R=301]    #Rewrite old URLs to parent directory

Basically what it saying is:

^ - from the start of the line
(.*) - collect everything into a variable
/stories-about-julian-/ - until you reach this, and ignore the rest of the URL.

It then builds up the new URL replacing $1 with what it picked up in the first (), namely everything up to the string you are matching.

I did a quick test using Test your RewriteRules for Apache mod_rewrite and it seems to work.



Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#75525
Avatar

Community saint

temp-

Thanks so much. Seems I was getting closer but still missing the mark by a wide margin. It seems then that creating the token and reusing it in the substitute URL would be pretty standard.

Thanks for the link to the tester - that's just plain cool and will save time as I finally try to come to grips with regex and rewrites.

So many other things I'd rather be doing.

Thanks as always.

Bob

EDIT: And, yes, that did work perfectly.
Back to the top
 
Posted
Rating:
#77920

Non-joined user

how do i change which page my login button takes me to? i can't remember how i did it before.
Back to the top
 
Posted
Rating:
#77921
Avatar

Fan in training

my current login takes me to my start page and i want to take it to my site page
Back to the top
 
Posted
Rating:
#77924
Avatar

Login button takes you back to wherever you were when it was clicked, but with template changes you could direct it to anywhere I think (IIRC ocPortal will accept logins on any screen, so it's just a case where the template sends the login form to).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#77933
Avatar

Fan in training

i'm still somewhat new to this cms and php stuff, so where and how would i change the code?
Back to the top
 
Posted
Rating:
#78747
Avatar

Community saint

I remember making redirects to seperate my forum into several forums.

I first made virtual roots of the forums needed, and got the virtual root number, made a link out of that.

After that I made a zone for that virtual root. Then I used the redirects to redirect forum-view and topic view to that zone when that link was clicked on.

It looks like what you are trying to do is similar… but I may be wrong.

Legends of Nor'Ova: A site powered by ocPortal; home of the Legends of Nor'Ova tabletop RPG wiki and community.

Like ocPortal? Want to thank Chris and gang somehow? Then help out in the chat room! It really needs your help! Just open it in a tab everytime you open your web browser, and when you hear a "ding", check it out!

"Those who want help should first be willing to give help."
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: