Jump to content

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


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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