I have installed Drupal in the /drupal folder (wont do THAT again!) and am now pulling my hair out trying to remove the /drupal element from the URL.
I am able to type in www.coghlancapital.com and have it display the home page but as soon as I click on a menu the drupal appears in the URL even though if I then remove it manually I can view the correct page.
I have added an .htaccess file to the root as below:
RewriteEngine on
RewriteRule ^$ /drupal/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /drupal/$1 [L]
The /drupal .htaccess file has this:
RewriteBase /drupal
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ /drupal/index.php?q=$1 [L,QSA]
and I changed the BaseURL in drupal/sites/default/settings.php as below:
$base_url = 'http://www.coghlancapital.com/drupal';
I will be highly appreciative if anyone can tell me what I missed?
Thanks,
Paul
Comments
_
Try clearing your caches at admin/settings/performance
The old links are probably still in the menu cache.
Pete.
'fraid not, just tried it.
'fraid not, just tried it. Thanks for the comment though.
Paul
Do you use pathauto? If yes
Do you use pathauto?
If yes go check status on alias.
Try to rebuild menus with menu_rebuild()
Or if you have devel rebuild menus in devel block.
And you are trying to remove /drupal/ stuff ? Do you moved all your site from /drupal/ to / ?
Quite don't get there sorry.
armababy, sorry maybe I
armababy, sorry maybe I wasn't clear.
I have installed Drupal int he /drupal folder BUT dont want /drupal to appear in the URL.
I have made changes to the following files are described in my dfirst post:
root .htaccess
/drupal .htaccess
/drupal/site/default/settings.php
I can enter www.coghlancapital.com and reach the site just fine BUT when I click on a link or menu the /drupal element of the URL pops back in. If I backspace over this so that the /drupal is deleted I can still access the page just fine.
Thanks,
Paul
=-=
I don't believe you are supposed to change both. try with base_url set in settings.php if that doesn't work. Revert the changes and then apply .htacess alteration.
Much easier since you want it to be called from the domain root to consider changing your docroot to point to the drupal subdirectory on your host using your host panel or move the entire installation up to the root.
Thanks, just tried BaseURL
Thanks, just tried BaseURL change in only drupal .htaccess and then only in settings.php, same result.
This is really quite odd!
Paul
=-=
rereading your OP.
you don't add anything to the root, and you don't add anything to drupal's .htacess. you simply comment the needed line of code.
the .htaccess file MUST be in the drupal folder, not outside of it.
Yes, the /drupal .htaccess
Yes, the /drupal .htaccess file includes the following:
RewriteBase /drupal
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ /drupal/index.php?q=$1 [L,QSA]
In case there is confusion below is the ENTIRE .htaccess file that resides within the /drupal folder.
Thanks for taking the time to think about this issue.
Paul
Edited by: VM; Removed pasted .htaccess file=-=
In the future please drupalbin or pastebin code, than link to that code in your comments or posts. No need to pollute the thread with an entire file. Thanks.
why is this uncommented?
Are you using a Virtual Doc Root?
If not you should be using the one above it
Thanks again WM. OK, maybe I
Thanks again WM. OK, maybe I need a beer but regardless as to which is un-commented surely the line below does the same thing no matter where it sits?
RewriteBase /drupal
Looking at your last post they are both the same???
Am I going mad? It is possible)
Paul
=-=
ah yea my bad wasn't paying close enough attention.
What is the reasoning behind NOT moving the install to the public root? so as not to jump through these hoops.
I just did a sandbox install in a subdirectory and it worked perfectly fine using /drupal uncommented. I suspect a server issue in some way but that's purely a guess.
OK, so here is a REALLY basic
OK, so here is a REALLY basic question. Can I now simply move files to the root OR, as I suspect, will that break things hard coded during the install.
I guess to be honest either way it might be easier to simply re-install but if I can drag to the root that would be preferable.
Thanks,
Paul
=-=
drupal can be moved without issue. It is relative to it's own index.php. At worst a cache clearing would be required.
The only gotcha is absolute urls which may have been used in content. Hopefully, you kept your development and such using relative urls. However if you've used absolute urls in your content, you can do a search on the DB and remove the /drupal/ part of the path from all content.
Personally, I'd just change my document root on the host to point to the drupal subdirectory making that directory what is called when your domainname is called in a browser. This is just as effective.
_
That's what I'd do; it makes it easier to manage if you want to add other VHosts later (such as a test site).
Pete.