on links and possibly .htaccess

Reply

Join Date: Apr 2007
Posts: 4
Reputation: augustinus is an unknown quantity at this point 
Solved Threads: 0
augustinus augustinus is offline Offline
Newbie Poster

on links and possibly .htaccess

 
0
  #1
Apr 17th, 2007
is there a way to edit .htaccess so that when I include links on my HTML pages with the <a href> tag, I can abbreviate links within the same site? For example, if I want to have a link from
index.html in the parent directory to /plans/index.html (which is a subdirectory) I want to be able to just write <a href="/plans/">Here</a> in the HTML. Conversely, when linking back to index.html on the parent directory, I'd want to just write <a href="/">.
I tried fooling around with .htaccess to redirect links but apparently it does it only when that link is entered into the browser by the visitor. Is there another way to be doing this? ANy help would be appreciated!
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: on links and possibly .htaccess

 
0
  #2
Apr 18th, 2007
That should work without modification to your .htaccess file.

The only thing that might be an issue would be indexing. So if you see a list of files in the directory instead of the page you expect then try adding the following lines to your .htaccess file:

#this will turn off indexing (the list of files
Options -Indexes
#this will make a /directory/ link point to index.html
DirectoryIndex index.html
Last edited by DanceInstructor; Apr 18th, 2007 at 12:25 am.
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 4
Reputation: augustinus is an unknown quantity at this point 
Solved Threads: 0
augustinus augustinus is offline Offline
Newbie Poster

Re: on links and possibly .htaccess

 
0
  #3
Apr 19th, 2007
Thanks for the suggestion! but unfortunately no luck... when I click the link it still gives be a "not found" error page. I double checked the link and if I placed the file in the right place but no problems there... just a question though.

is there a difference between
"IndexIgnore *" and "Options -Indexes" in the .htaccess file?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Existing Scripts Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC