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.


Redirection

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#44385 (In Topic #9843)
Joe
Avatar

Honoured member

If someone goes to domain.com/forum/index.php?action=chat

How can I redirect that to: domain.com/index.php?action=chat

So basically instead of putting an HTML redirect in the /forum/ directory that redirects to / maybe something I could put in a .htaccess that will redirect the viewer to the same page only in a different directory (this way if they view a page within /forum/, they won't be given a 404 not found error, instead they will be redirected to the appropriate page in the root)?

Back to the top
 
Posted
Rating:
#44395
Avatar

Admin Zone > Structure > Redirects


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:
#44450
Joe
Avatar

Honoured member

No, I don't mean with ocPortal. I recently moved my forums from /forum/ to the root directory of my website (/) and some people are unaware of the change and will continue to use forum links that were once valid links but now return "not found" errors due to the forums being moved.

So if someone visits any URL that points anywhere in the /forum/ directory, I want them redirected outside of this directory including the URL parameters given. Here are a few examples:

domain.com/forum/search.php -> domain.com/search.php
domain.com/forum/index.php?page=members -> domain.com/index.php?page=members
domain.com/forum/index.php?action=login -> domain.com/index.php?action=login

Back to the top
 
Posted
Rating:
#44451
Avatar

Community saint

Hey Joe! Are they on the same server? If so, symlinks are your friend!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#44465
Avatar

Community saint

SoccerDad said

Hey Joe! Are they on the same server? If so, symlinks are your friend!
I use those for 2 sites that have the same arcade games.
You do need to have ssh for symbolic links.


I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#44468
Joe
Avatar

Honoured member

Never heard of it, but I did some research and it sounds like it's what I'm looking for, so I'll try this out. Just need to contact my host and ask them to enable SSH. :P

Thanks SoccerDad.


Last edit: by Joe

Back to the top
 
Posted
Rating:
#44469
Joe
Avatar

Honoured member

Perhaps I'm doing it wrong, but basically all it does is act like an invisible index.html file and redirects you from /forum/ to /. If I include an 'index.php' at the end of the URL, I get a forbidden error.

Code

ln -s /home/lvrcr/public_html/forum /home/lvrcr/public_html

Back to the top
 
Posted
Rating:
#44470
Avatar

Community saint

The first time I heard of it was with host simplex when they suggested it to save space on the server.
I am not real sure how to make one as the last 2 I have used have been created by my host.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#44472
Avatar

RewriteRule example

Look at '1'.
You can simplify it and remove those 'RewriteCond' lines as you know the stuff doesn't exist.


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:
#44473
Joe
Avatar

Honoured member

Nice Chris. :D

Thank you!

Back to the top
 
Posted
Rating:
#44507
Avatar

Community saint

Chris Graham said

RewriteRule example

Look at '1'.
You can simplify it and remove those 'RewriteCond' lines as you know the stuff doesn't exist.
wow posted 2004, that is old I wonder if there is an updated way of doing the same thing.
Although I have to ask with this do all files. I mean if a script is requesting a php file will it see the file in the folder it should be redirecting to using that feature?


Better way of saying it. Say I wanted to have 2 ocportal installs share themes so on the themes folder on one I empty it and put the number 1 on that page. Will ocportal be able to see the themes


Last edit: by amichan

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
Posted
Rating:
#44508
Avatar

no


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:
#44509
Avatar

Community saint

Thanks so hostpc was wrong. When I switched to hostpc I requested a symbolic link just like the one the last host had made, which turned out to be a file I could not transfer for some reason.
When I requested it they mentioned 2 other ways of doing it a php file and the .haccess file. The .haccess file is ruled out thanks to you and I assume the php file they were talking about is also ruled out.

From my understanding then a symbolic link is the only way to do what I want.

I run http://otakuplayground.com and am hopping to make themes and other things for ocportal even though I no longer use it for otakuplayground.com I still love it and feel it could go far with the right help. It needs themes and needs people to advertise for it.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: