Hi,

I'm trying to migrate a site from my local test server to a public server but attempting to install in a sub directory. I get the home page to show but none of the links to other pages work. Exception is ?q=user/login, but once I've logged in I can't access anything.

Following error message with any page I try to access:

Not Found
The requested URL /home/com/*mydomain*/html/*subdirectoryname*/index.php was not found on this server.
Apache/1.3.41 Server at *mydomain* Port 80

I would be very glad for any help!

Thanks,
Philip

Comments

vm’s picture

check settings.php for a $base_url that you may have set

have you tried clearing cache?

rpk’s picture

Thanks for your reply!

Unfortunately it still doesn't work. I didn't have the $base_url set. I now tried it with and without setting the base url to my sub directory but the pages don't work. I also cleared the cache, but no effect.

Thanks,
Philip

vm’s picture

use dirty urls and navigate to your administer -> menus ie: yoursite.com/?q=admin/build/menu

hoping that will refresh the menu links ...

Seems to me like cache problem here.

rpk’s picture

Using the url you provided got me to the admin build menu page but none of the linked pages from there worked (e.g. http://www.mydomain.com/SUB/admin/build/menu-customize/primary-links

However, I tried adding the '?q=' before 'admin' and that seems to make every page work!
That way I could check the menu links and they are simply node/1 etc.

Does that shed some light on what's going on with my site?

Philip

vm’s picture

yep, seems you have a problem with clean urls.

that said, in the root of your installation , is there a .htaccess file ?

rpk’s picture

Yes, I uploaded the .htaccess file.

Philip

vm’s picture

are you sure the server supports mod_rewrite?

you may have to turn off clean urls manually in the database rerun the test in administer -> clean urls.

have you made any alterations to the .htaccess file?

I tend to turn off clean urls
clear cache tables

before I export the database

I then turn clean urls back on after I import the db.

rpk’s picture

My first attempt, before writing on the forum, to solve this was actually to turn off clean urls which I had used on the site during development. After testing once again on my local server I then exported the database and uploaded to the server.
I never tweaked the .htaccess file.

I have no idea about:
- what mod_rewrite is.
- how to manually turn of clean urls in the database.
- how to clear cache tables (assuming this is database related and not just the browser cache)

Thanks for your help!

Philip

vm’s picture

db cache can be cleared in administer -> performance
or by emptying the tables labeld cache or _cache in the database using your database tool, ie: phpmyadmin

mod_rewrite is what allows clean urls to work on a server. It's an apache module and without it, drupal cannot use clean urls.

rpk’s picture

It seems caching mode was disabled. Clearing the cache via admin>performance didn't fix the url issues.

Philip

vm’s picture

almost puts me out of ideas.
caching disabled doesn't mean caching is totally disabled Drupals till caches things. I'd clear the tables manually.
.htaccess corrupted maybe?

what happens if you remove it?

have you checked on mod_rewrite?

if you can naviagte with dirty urls, but the clean urls aren't working something isn't right with the server ie: mod_rewrite or with your .htaccess file provided your server does indeed have mod_rewrite.

you are putting this on an apache server ? and not a windows server ?

rpk’s picture

I removed .htaccess but nothing seems to have changed. I'm uploading to an Apache server and will check with the hosting company if they have mod_rewrite enabled.

I guess if they confirm that mod_rewrite is enabled I will just start from scratch. Double check again if all clean urls are disabled on my development site, then export the database and upload everything.

Just to confirm: disabling clean urls is being done via Drupal admin of each individual page, right? There isn't a global setting for this, as far as I know. Please let me know if that is correct!

Thanks for all your help!
Philip

vm’s picture

clean urls is turned off in administer -> clean urls

you'll have to get there using yoursite.com/?q=admin/settings/clean-urls

rpk’s picture

That's what it was!! Now the links all work.
I guess I just wasn't familiar enough with Drupal's interface.

Thanks so much for your help and advice!! Really appreciated!

Philip

alibasham’s picture

i have the same issue, but i can not log on to drupal.

because when i enter my user name and pass word it goes to a page not find error!

Please help!

Regards,

Ali