Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [How To?] How can I redirect a php file to a misc.php page?
#1
Not Solved
So basically, what I want to do is have Example.php "redirect" to /misc.php?action=exampleaction.

And by "redirect" I mean that I want to have it so it just grabs the content of that misc.php page and serve it while still on Example.php

Is there a way to do this with MyBB?
[Image: misc.php?page=signature]
Reply
#2
Not Solved
check if this helps => new page using misc.php
Reply
#3
Not Solved
No, I'm trying to make a php file in the root of the forum that will serve the content that is generated when going to /misc.php?action=example
[Image: misc.php?page=signature]
Reply
#4
Not Solved
maybe its what you are looking for
<?php
header ('Location: /misc.php?action=example');
?>
[Image: cafaf18ba2.gif]
FileSquid is under development
[Image: trk1]
Reply
#5
Not Solved
(05-02-2016, 06:16 PM)Dark-Power-Invader Wrote: maybe its what you are looking for
<?php
header ('Location: /misc.php?action=example');
?>

This gave me a 404 error when I went to the php file.
[Image: misc.php?page=signature]
Reply
#6
Not Solved
then use http;//yourdomain/misc.php instead of /misc
[Image: cafaf18ba2.gif]
FileSquid is under development
[Image: trk1]
Reply
#7
Not Solved
Still got a 404 page.
[Image: misc.php?page=signature]
Reply
#8
Not Solved
I would probably do a rewrite rule in your .htaccess file, so that example.php doesn't exist as a physical file.
Reply
#9
Not Solved
(05-02-2016, 06:49 PM)laie_techie Wrote: I would probably do a rewrite rule in your .htaccess file, so that example.php doesn't exist as a physical file.

How would I do that? (I'm horrible with .htaccess files)
[Image: misc.php?page=signature]
Reply
#10
Not Solved
(05-02-2016, 07:45 PM)MI-6 Wrote:
(05-02-2016, 06:49 PM)laie_techie Wrote: I would probably do a rewrite rule in your .htaccess file, so that example.php doesn't exist as a physical file.

How would I do that? (I'm horrible with .htaccess files)

Please note that the following code is not tested, but should serve as a starting point.

RewriteEngine On
RewriteRule "^example\.php$" "misc.php?action=exampleaction" [L]
RewriteRule "^example\.php\?(.*)?$" "misc.php?action=exampleaction&$1" [L]

The first RewriteRule matches example.php, while the second one includes an optional query string.

L is a flag which says that if a request matches the RewriteRule, don't process any other RewriteRules.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)