Go Back  HTML Forums - Free Webmaster Forums and Help Forums > SERVER ADMINISTRATION > Linux Administration
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 03-25-2008, 01:30 PM
  #1
hammerstein_04
Deity (Level 17)
 
hammerstein_04's Avatar
 
Join Date: Jan 2004
Location: New Jersey, USA
Posts: 852
iTrader: (0)
hammerstein_04 will become famous soon enough
htaccess

Not quite sure about this one,so apologies if it's in the wrong place,

I have developed some scripts that require redirects, and on my development machine this works fine. In a subdirectory of the main site, 'instructors', I have the following .htaccess file;

RewriteEngine On

RewriteRule ^(.*)$ index.php

This works fine on my development machine; http://localhost/instructors

But on the main site, I have to put a / after instructors to get it to work properly, otherwise I get Bad Request. Can anybody help with this?

Comments on this post
tmw-webdesigns agrees:
__________________
For web design and software development;


Hypersonicscream
hammerstein_04 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-25-2008, 06:00 PM
  #2
Horus_Kol
Mod of the Underlay
 
Horus_Kol's Avatar
 
Join Date: Jun 2002
Location: At a desk, hooked up and ready to rock
Posts: 16,213
iTrader: (0)
Horus_Kol is a jewel in the roughHorus_Kol is a jewel in the roughHorus_Kol is a jewel in the roughHorus_Kol is a jewel in the rough
i know that Apache runs on both Windows and *nix, but it seemed to make sense to put it in here....

anyways - on to your problem...

i think this comes from the fact that you are in a sub-directory...

you could try:

Code:
RewriteEngine On

RewriteRule ^(.*)$ index.php [QSA,L]
RewriteRule ^instructors/(.*)$ instructors/index.php [QSA,L]
Horus_Kol is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-26-2008, 07:14 AM
  #3
hammerstein_04
Deity (Level 17)
 
hammerstein_04's Avatar
 
Join Date: Jan 2004
Location: New Jersey, USA
Posts: 852
iTrader: (0)
hammerstein_04 will become famous soon enough
thanks for moving that Horus, appreciate it. However, I'm still getting bad request. I can do /instructors/ and /instructors/index.php and they work fine, but /instructors still gives me a bad request.
__________________
For web design and software development;


Hypersonicscream
hammerstein_04 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-26-2008, 10:17 AM
  #4
hammerstein_04
Deity (Level 17)
 
hammerstein_04's Avatar
 
Join Date: Jan 2004
Location: New Jersey, USA
Posts: 852
iTrader: (0)
hammerstein_04 will become famous soon enough
I've been talking with my hosts, and they gave me;

Options FollowSymLinks MultiViews
RewriteEngine On
RewriteRule ^/instructors/(.*)$ index.php

now, it tries to redirect but the objects I need are invalid now, and I get can not access class 'user'..
__________________
For web design and software development;


Hypersonicscream
hammerstein_04 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-26-2008, 06:58 PM
  #5
Horus_Kol
Mod of the Underlay
 
Horus_Kol's Avatar
 
Join Date: Jun 2002
Location: At a desk, hooked up and ready to rock
Posts: 16,213
iTrader: (0)
Horus_Kol is a jewel in the roughHorus_Kol is a jewel in the roughHorus_Kol is a jewel in the roughHorus_Kol is a jewel in the rough
try:
Code:
RewriteEngine On

RewriteRule ^(.*)$ index.php [QSA,L]
RewriteRule ^instructors/?$ instructors/index.php [QSA,L]
RewriteRule ^instructors/(.*)$ instructors/index.php [QSA,L]
Horus_Kol is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
« Previous Thread | Next Thread »


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 04:55 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.