Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Tyler Cassidy Posted February 18, 2016 Posted February 18, 2016 Hi, I'm trying to setup a proper mod_rewrite rule to get the API working with my website without using .htaccess. Currently I have the following but it doesn't seem to redirect to the API just the main website. Any ideas? Options -MultiViews RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) fcgi://127.0.0.1:9000/home/tyler/ips/404error.php [P,NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/api/.* fcgi://127.0.0.1:9000/home/tyler/website/api/index.php [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},P] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . fcgi://127.0.0.1:9000/home/tyler/www.yegdnb.com/index.php [P]
Tyler Cassidy Posted February 19, 2016 Author Posted February 19, 2016 Ok I figured it out just had to tweak my condition statement a bit: Options -MultiViews RewriteEngine OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) fcgi://127.0.0.1:9000/home/tyler/www.yegdnb.com/404error.php [P,NC]RewriteCond %{REQUEST_URI} ^/api/.*RewriteRule . fcgi://127.0.0.1:9000/home/tyler/www.yegdnb.com/api/index.php [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},P]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . fcgi://127.0.0.1:9000/home/tyler/www.yegdnb.com/index.php [P]
Recommended Posts
Archived
This topic is now archived and is closed to further replies.