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 08-03-2009, 05:44 PM
  #1
eventide
Veteran (Level 7)
 
eventide's Avatar
 
Join Date: Mar 2009
Location: Central Minnesota
Posts: 66
iTrader: (0)
eventide is an unknown quantity at this point
Question Need help with .htaccess

I am doing a little bit of exploring mod_rewrite and the htaccess file.

I tried the following in an .htaccess file placed it in a subdirectory of my site:
Code:
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !aWebPage.php$
RewriteRule ^(.*)$ ../ [NC]
My understanding is that this will allow direct requests to the page "aWebPage.php", but redirect all other traffic to this folder back to the sites's root folder, meaning the index.php file will load. That's my intention, at least...

It kind of works. When the aWebPage.php page is loaded directly, everything is fine, but when I point the browser to any other file in the same folder, the browser is redirected to the root folder (and the index.php file) as intended, but none of the images, css, or java loads for the index.php file- just the text on the page.

However, when I call the index.php file directly it loads fine.

There's something going on here with the redirect that I'm missing/not understanding. Could someone help me out?

Thanks!
__________________
f u dn rd ths u cn gt a gd jb n prgrmmng

Eventide Web Design
eventide is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-07-2009, 09:13 AM
  #2
eventide
Veteran (Level 7)
 
eventide's Avatar
 
Join Date: Mar 2009
Location: Central Minnesota
Posts: 66
iTrader: (0)
eventide is an unknown quantity at this point
It'd be great if anyone had any suggestions as to what I may be doing wrong or missing!

Thanks for any help!

(Or maybe I don't have this in the right forum?)
__________________
f u dn rd ths u cn gt a gd jb n prgrmmng

Eventide Web Design
eventide is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-20-2009, 12:30 AM
  #3
andyf
Soldier (Level 11)
 
Join Date: Oct 2006
Posts: 102
iTrader: (0)
andyf is an unknown quantity at this point
it seems that there's is something wrong in above code !!!
One of our tech support staff advised to use below code and try again

========== Code yto use ===========
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !aWebPage.php$
RewriteRule ^(.*)$ / [NC]

You need to change RewriteRule ^(.*)$ ../ [NC] to RewriteRule ^(.*)$ / [NC]

hope this helps you !!!!
__________________
UK Website Hosting Services with 24x7 free tech support.
UK Dedicated Server hosting
andyf is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-20-2009, 09:11 AM
  #4
eventide
Veteran (Level 7)
 
eventide's Avatar
 
Join Date: Mar 2009
Location: Central Minnesota
Posts: 66
iTrader: (0)
eventide is an unknown quantity at this point
Thanks! I'm glad someone finally answered!

I'll give that a try and let you know if it works.
__________________
f u dn rd ths u cn gt a gd jb n prgrmmng

Eventide Web Design
eventide is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-22-2009, 07:51 AM
  #5
eventide
Veteran (Level 7)
 
eventide's Avatar
 
Join Date: Mar 2009
Location: Central Minnesota
Posts: 66
iTrader: (0)
eventide is an unknown quantity at this point
I finally had a chance to try out the changed code, but unfortunately it didn't work. Now it just allows me to access any file in the folder - as if the rule wasn't there at all...
__________________
f u dn rd ths u cn gt a gd jb n prgrmmng

Eventide Web Design
eventide is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
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 02:39 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, 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.