By drshields on
Hello,
I am trying to create a menu in will link to a file in the /files directory, however when I put the path in the "Edit Menu Item" page (i.e. files/hr/f1040.pdf) and his Save, it is linking to "http://localhost/site/index.php?q=hr/f1040.pdf" ... any way to get rid of the full path name that it is putting at the beginning of the path I created? Like a directory tag, or something like that?
Comments
I don't think so. Now why
I don't think so. Now why would you want to do this anyways? Drupal is just figuring out the base path for you and inserting it. Makes it more portable when you move off your test server I think. You could setting up a custom block with your own link if you really don't want this behavior.
-joon
www.dvessel.com
I would want to do it
I would want to do it because it's not pointing to a valid file. The way it works now, it's pointing to index.php-and-then-some-arguments-here. I don't want it to point to index.php at all...I want it to point to /files/myfile ...see what I am saying?
No Problem ...
Try this - use "../files/hr/f1040.pdf" (remove the quotes) for your Path in the Menu Item. This "backs up" to the DocumentRoot and bypasses index.php.
Oops - Works in Firefox only !?!?
This doesn't seem to work in IE. Not sure what to do that will work in both cases.
Ah - Here we go...
Try this - use "./files/hr/f1040.pdf" (ONE DOT ONLY) (remove the quotes) for your Path in the Menu Item.
Still Not Working
I tried both of the following in my PATH for the menu item:
./files/hr/f1040.pdf
../files/hr/f1040.pdf
After applying changes and navigating to the menu, it is still putting the following before my path:
http://localhost/mhfanet/index.php?q=./files/hr/f1040.pdf
Is there another setting that I need to modify somewhere?
Clean URLs
You must have "Clean URLs" disabled. I have Clean URLs enabled and it works like a charm. If I turn Clean URLs off, I get exactly the behaviour you are describing.
Hmmm... Okay, new problem.
Hmmm... Okay, new problem. When I run the 'Clean URL's' checker, it is giving me a page cannot be found error. Here is the link from within drupal that is supposed to run the clean-url check:
http://localhost/mhfanet/index.phpadmin/settings&#clean_url
I've tried putting a slash ( / ) in between the .php and the admin part of that string, but that didn't work either. Any ideas?
This is normal
Cool - now we are getting somewhere. Notice that the paragraph that link is in reads in part:
Go to this page on Drupal.org for troubleshooting guidance:
http://drupal.org/node/15365
I experienced EXACTLY the same thing you are and was able to get Clean URLs to work by following those instructions. I will of course be happy to help further if you still experience problems. Cheers.
I followed the instructions
I followed the instructions on that page you gave me, including changing the error mapping in IIS for 404 and 405 errors to redirect them to index.php, and I pasted the following code into the bottom of my 'settings.php' file:
Now, when I run the clean URL's test, I got an error that simply says "No input file specified." If I can't get this to work right, I may just forget about it for the time being, or install Apache and try that.
Oh - IIS
Sorry - I use Apache - I got that to work with little problem. I'm completely unschooled in IIS. Sorry I couldn't help more.