943,667 Members | Top Members by Rank

Ad:
Apr 17th, 2007
0

on links and possibly .htaccess

Expand Post »
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!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
augustinus is offline Offline
4 posts
since Apr 2007
Apr 18th, 2007
0

Re: on links and possibly .htaccess

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.
Reputation Points: 17
Solved Threads: 14
Posting Whiz
DanceInstructor is offline Offline
355 posts
since Feb 2005
Apr 19th, 2007
0

Re: on links and possibly .htaccess

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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
augustinus is offline Offline
4 posts
since Apr 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Configuring Readymade Scripts Forum Timeline: front page path
Next Thread in Configuring Readymade Scripts Forum Timeline: XML Menu Help - Delaying modules?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC