Note that there are some explanatory texts on larger screens.

plurals
  1. POhtaccess not redirecting url
    primarykey
    data
    text
    <p>So I've been stuck on this a bit, and its more or less put a top on my project.</p> <p>Just started up at a new job, and my current assignment is to create an API system for a new project we're launching. Its based on a modified version of wordpress, and my objective here is to take any request that goes to /contrib/api and instead have it direct to a file I have setup to sort out the incoming URL and redirect accordingly.</p> <p>Here's what I currently have:</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase /contrib/ RewriteCond %{REQUEST_URI} ^/api/ RewriteRule ^/content/apis/apis\.php$ - [L] RewriteRule ^index\.php$ - [L] # uploaded files -- no longer needed since we're serving files directly via apache # RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /network and /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin/network$ $1wp-admin/network/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wordpress/$2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ wordpress/$2 [L] RewriteRule . /contrib/index.php [L] &lt;/IfModule&gt; </code></pre> <p>This was all here before me, except for near the top:</p> <pre><code>RewriteCond %{REQUEST_URI} ^/api/ RewriteRule ^/content/apis/apis\.php$ - [L] </code></pre> <p>My goal, as stated, is to take any request from /contrib/api/ and redirect it to my file instead of continuing. Instead, it seems to skip on and go ahead and point to the wp-admin (after a redirect I think). Regardless, it seems my command isn't getting caught, and I'm not sure why.</p> <p>I thought that the commands are processed first come, but if its continuing on, would moving my code to the end make it work?</p> <p>I know this is an easy thing to test, but I was hoping I could get some insight on what I'm doing/doing wrong, plus I don't yet have access to the server to actually upload/test code without going through my boss, and I'm thinking 2 weeks in, probably not a good idea to ask my boss to test code every 5 minutes, heh :(</p> <p>EDIT: As per Bob Vale's notice, fixed the path issue.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload