Jump to content

JayNic

New Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About JayNic

  • Rank
    Newbie
  1. Thanks for your help - I ended up getting it working with the following: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /api RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)$ index.php?request=$1 [QSA,NC,L] </IfModule> and in my /api/index.php file I can see everything: //api/index.php if (!array_key_exists('HTTP_ORIGIN', $_SERVER)) { $_SERVER['HTTP_ORIGIN'] = $_SERVER['SERVER_NAME']; } $echo = [ "request" => $_REQUEST['request'], //The request directory with get params "getParams" => isset($_GET) ? $_GET : nul
  2. Thanks for the reply - I think I'm still not getting it right... cause now I still get the "index of /api" screen. I have the following structure: the and files: .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /api RewriteRule ^api\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /api.php [L] </IfModule> api.php <?php header("Content-Type: application/json; charset=utf-8"); echo json_encode(["hey"=>"there"]); but I'm still getting this:
  3. Hi all, I really don't understand htaccess very well, and I feel like what I'm trying to do is simple, but I can't get it to work. I have a wordpress site, and in the public_html folder is the .htaccess file with the following body: # Use PHP54 Single php.ini as default #AddHandler application/x-httpd-php54s .php # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress That's all fine for the pu
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.