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?
#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.


Messages In This Thread
RE: How can I redirect a php file to a misc.php page? - by laie_techie - 05-02-2016, 09:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)