| | |
on links and possibly .htaccess
Please support our Existing Scripts advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2007
Posts: 4
Reputation:
Solved Threads: 0
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!
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!
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
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.
•
•
Join Date: Apr 2007
Posts: 4
Reputation:
Solved Threads: 0
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?
is there a difference between
"IndexIgnore *" and "Options -Indexes" in the .htaccess file?
![]() |
Similar Threads
- custom .htaccess file 301 Redirect to non www form (Search Engine Optimization)
- Trouble with .htaccess & redirecting dynamic URLs (Linux Servers and Apache)
- Does Google Penalize for too many inbound links (Search Engine Optimization)
- Shortcuts/Links failing...help! (Windows NT / 2000 / XP)
- vBulletin mod_rewrite (PHP)
- vBulletin mod_rewrite for vB 3.0.7 (Existing Scripts)
Other Threads in the Existing Scripts Forum
- Previous Thread: front page path
- Next Thread: XML Menu Help - Delaying modules?
| Thread Tools | Search this Thread |





