Jump to content

Help with my open source script (.htaccess is the only broke part)


jonsjava

Recommended Posts

I have an open source project (https://github.com/jonsjava/patchdashboard)

 

Here's my .htaccess for this:

RewriteEngine On
RewriteBase "/pm/"
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /patches/server/(.*)$ patch_list?server= [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /packages/server/(.*)$ packages?server= [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /search/exact/(.*)$ search?package=&exact=true [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /search/(.*)$ search?package= [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /rewrite_check/(.*)$ rewrite_check.php [QSA,NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)$ index.php?page= [QSA,L]

Basically, I want it so that no matter where they drop this script ("/", "/patch_dashboard/", "/pb/", etc.) it will redirect as intended.

 

In the example I provided, the document root is "/pm/". When I try to hit a page ("http://dev2.curltools.com/pm/patches/server/demo1" for example), it gives a 404.

 

If I hard code in each rule the base path, it just redirects everything to the main page.

 

Any help would be greatly appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.