Link to home
Start Free TrialLog in
Avatar of the_ratzenator
the_ratzenatorFlag for United States of America

asked on

Drupal Issue: How do I get rid of the drupal in my website's path?

I am trying to figure out how in the heck to get rid of drupal in my site's path. I go to my website, and all is well until I click on a menu item then it looks something like this:

"www.mysite.com/drupal/node/2" 

I simply want the following to occur:

When I go to www.mysite.com and click on, let's say, my "About Us" menu item, I just want it to show the following in the path:

"www.mysite.com/aboutus" 

AND NOT something like

 "www.mysite.com/drupal/node/4"

I have searched all over the Internet and have not found anything that can help me. So, I wanted to reach out and ping the EE community for help so here I am. If you can please help me I would be incredibly grateful as always.

Thank you very much
Avatar of Ultrus
Ultrus
Flag of United States of America image

Hi the_ratzenator,
I'm guessing you have Drupal installed at www.mywebsite.com/drupal .

If so, you can move all the files inside of your drupal folder to the top level directory outside of your drupal folder without major issues (make sure you have backups of anything outside of the drupal folder first so you don't overwrite anything like another index.php file or simething).

After that, you'll need to clear the cache and check your settings.php file in case there are any variables pointing to the drupal folder (likely not). Also, if your content images and/or links point to something in the drupal folder, those content items will need to be updated as well.

Let me know if that helps inspire something. :)

Best regards,

Chris
here's an article on clean urls
http://drupal.org/getting-started/clean-urls

here's a link to changing the base url
http://drupal.org/node/50322
As a follow-up to what Ultrus said, be especially sure to get the .htaccess file from inside the drupal directory and move it to your webroot. Failing to do so will make it so clean URLs no longer work.

The .htaccess file is hidden normally so you will likely need to go in via the command line to actually move it.
One more note: If you want to change node/2 to about-us once you get everything moved, make use of the pathauto module:
http://drupal.org/project/pathauto
Avatar of the_ratzenator

ASKER

Hey guys, sorry for the latency in my response, been busy. Well prior to this EE question I opened up, I actually did move the contents of the drupal folder to my public_html location and the site is fine but drupal still exists in the path as stated. I also did clear the cache as well and still no luck. I use filezilla to connect to my site and i do see the .htaccess file in the public_html location as well. However, I do see something that is a tad awkward, I have changed the $base_url variable like 3 times already in the settings.php from www.mysite.com/drupal to just www.mysite.com, but it keeps somehow changing back to www.mysite.com/drupal. The settings.php file is located in /drupal/sites/default/settings.php. Should I move settings.php to the public_html location?
Move EVERYTHING out if the Drupal folder. At that point make a backup and delete the Drupal folder. The settings file you want to edit will then be mysite.com/sites/default/settings.php

You may need to edit you computer and/or filezilla settings to see hidden files. See if you can transfer the. htaccess file before deleting the drupal folder. You can also get a new one by downloading Drupal again from drupal.org.
It wouldn't change back like that unless you didn't have the right file permissions to actually make the change. Likely whatever tool you are using says the file is saved, but that isn't actually happening.
Ahh, I am such an idiot. Yeah you're right. I guess I was not paying much attention to where it said permission denied in Filezilla when I was trying to save the file back. Anyway, I did make the change from www.mysite.com/drupal to www.mysite.com as the value for the $base_url variable and now I am getting errors when trying to access pages after clicking on menu items saying www.mysite.com/drupal/drupal/node/2 etc cannot be found. I then changed it back to www.mysite.com/drupal, but the errors still exists. By the way, I am running Drupal 7.9 and now I cannot even access the Administration section because it is now telling me that I do not have the permissions like I used to. Wow, this is frustrating. I am going to invest in a Drupal book here soon. Anyone have any suggestions on how I can get this resolved? Thank you all
Hmm.

1. Clear drupal cache at mysite.com/admin/config/development/performance

2. See if that worked.

3. If not, let us know. :)
After clearing your cache, you should be able to access something like mysite.com/node/2

Best regards,
ASKER CERTIFIED SOLUTION
Avatar of Ultrus
Ultrus
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ultrus, I apologize about my lack of Drupal lingo, but I am very new at this and so this is all a learning curve for me. I don't really understand what you mean when you say:

Empty (but not drop) any table in your database including "cache" and "cache_anything_else_starting_with_cache".

I definitely cannot gain access to Administration at all nor can I even log out. Here is the error I get when I try to access Administration:

The requested page "/drupal/drupal/admin" could not be found.

Here is the error I get when I try to log out:

The requested page "/drupal/user/logout" could not be found.

I can see that the .htaccess file is located within public_html as well

I don't get why the path in both of these errors show drupal twice as if there is a subdirectory called drupal within a drupal directory. Damn, I hope I didn't screw the pooch on this one. Any thoughts on this? I am going to keep trying to research this more as well.

Okay, I figured something out, when I go to my site at www.mysite.com and then click on a menu item like Welcome, I get the following error that I have been getting:

The requested page "/drupal/node/2" could not be found.

However, if if I remove drupal from the path completely, I can access the various sections within my site to edit the contents. So for instance if I want to edit my Welcome page, I would just type in www.mysite.com/node/2 and it works just fine, but not www.mysite.com/drupal/node/2.

Please help. Thanks
Will upgrading to 7.10 possibly fix this issue?
Okay, I kind of fixed my initial problem with the error by disabling Clean URLs. I HAVE ABSOLUTELY NO CLUE why this fixed that but it did. Now back to trying to get rid of /drupal in the URL path when a menu option is selected. This is getting really frustrating.
Also, when I run a Clean URL test, it keeps failing. I just thought I should share this too. Thanks
Sorry for all the rambling above. I wanted to try and make this more easily understood and reiterate my initial problems. So here are the following solutions that I am trying to find:

1. How do I remove drupal from the URL path when a customer clicks on a menu option?

2. Also, not all menu options are experiencing this drupal in the path problem, only every other one. For instance, if you click on "Welcome" it will have the path as follows: "www.mysite.com/drupal/node/2". However, if you click on "About Us", it will have "www.mysite.com/node/3" with no drupal in the path. I don't understand why this occurs.

3. Then, I would like to use Clean URLs to get rid of the "/node/2", "node/3" and  so on and so forth URL paths, but when I go to "Administration/Configuration/Clean URLs" I get the following message:

"Clean URLs cannot be enabled. If you are directed to this page or to a Page not found (404) error after testing for clean URLs, see the online handbook."

Then when I enable Clean URLs, I receive the message that "the Clean URL test failed" and then I can no longer successfully navigate within my drupal administration site to make any modifications because I receive the following errors whenever I try to click on, let's say for instance the Configuration link, then I receive the following error:

"The requested page "/drupal/drupal/admin/config" could not be found."

I can get around this though by simply disabling Clean URLs, but I would like to use this feature to help my site look, well, clean as the name implies.

These are my 3 issues that I have been wracking my brain against for the last week. Any help on this, as always, is greatly appreciated.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What is the default location of the active.htaccess file?
Okay, I guess I am not really paying too close attention to my Filezilla components or however you refer to various functionality within this FTP client. I just realized that certain files were failing file transfers when I was trying to move my archives back over to my site and my .htaccess file was one of the failed transfers. This is what I did:

**The following steps were accomplished using Filezilla ver 3.5.2

1. I created a "mysite.com_archive" directory on my local computer's desktop
2. I then created a "public_html\drupal" directory in this local archive to move over ALL the contents of mysite's "public_html/drupal" directory
3. I transferred everything over to my locally archived location successfully
4. Within my local archive on my local system, I moved the ctools, panels, panels everywhere modules from the "\drupal\sites\all\modules" directory to the "public_html\modules" directory because I noticed that these modules were missing from the Modules section within mysite's drupal admin page (I have no idea why they were missing)
5. I then highlighted ALL of the contents of the locally archived "\public_html\drupal" location and then I dragged this over in Filezilla to "mysite.com/public_html" and I told Filezilla to overwrite all target files from newer sources.
6. I then ensured that "mysite.com/public_html/sites/default/settings.php" file's $base_url variable was set to "mysite.com" and NOT "mysite.com/drupal"
7. I then ensured that the .htaccess file was now located in "mysite.com/public_html"
8. I then logged into mysite.com's drupal admin page and then navigated to "Modules" and clicked on the Update tab and ran the updates that were there (it only showed the image Captcha update and then updated the database
9. I then ran "Clear all caches"
10. I then clicked on Clean URLs in the Configuration section and I there were no more errors showing that Clean URLs could not be enabled.
11. I then enabled Clean URLs and now "drupal" does not show up in my URL path whenever I click on a menu item.

I really appreciate your help Ultrus and stephencolson, you both guided me in the right direction. I am going to give you both points on this one.

I know you probably don't want to hear this but, I now have a new error that I am going to inquire about on a new thread - LOL. Seriously, I am not kidding. I will start on that tomorrow though because I am exhausted after this damn resolution. Thanks again brothers for the assistance.