Jump to content

htaccess mod_rewrite question

- - - - -

  • Please log in to reply
No replies to this topic

#1
SoN9ne

SoN9ne

    Programmer

  • Members
  • PipPipPipPip
  • 129 posts
Hey guys/gals,

I am using this code for my redirects:
# Redirect for health-it aliases

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} ^/(healthit|health_it)/ [NC]

RewriteRule ^(healthit|health_it)/(.+)$ /health-it/$2 [NC,L,R=301]


# Load pages for health-it while keeping the URL masked

RewriteCond %{REQUEST_FILENAME} !-f

#RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} ^/health-it/ [NC]

RewriteRule ^health-it/(.+)$ /health-it/loadPage.php?p=$1 [NC,L]

The first redirect just redirects the possible aliases to the correct URI and this works fine ( I only included it because I felt it was worth including), it's the second one I am having trouble with.
On my localhost this redirect works properly but once live, it acts different.
The URL structure I am expecting (and I get on my localhost) is :
http://www.mysite.co...aimsconsultant/
This will load this particular sub-system (with or without the trailing /). The issue I am having is, once live, if the URI is missing the trailing slash it gives me this:
http://www.mysite.co...=aimsconsultant
I am completely baffled by this because I do not have this happen on my local dev and I actually had to resolve that issue before and it worked fine. The issue is on my live server. Can anyone spot why this is happening? I am really puzzled and I cannot figure this out so I thought some fresh eyes may be able to help resolve this.

Thanks in advanced :)

Edited by SoN9ne, 13 January 2012 - 08:23 AM.

"Life would be so much easier if we only had the source code."




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users