Hey everyone. I have been designing drupal sites online because i have been scared of learning how to setup Wampserver. I decided to bite the bullet and got it working with a fresh D7 install.

I downloaded the database and the complete website of mine that i have been designing over the internet
Every link (menu link) leads back to the wampserver localhost page. I have searched for about an hour on Google looking for a solution and haven't found any.

I am guessing it is some sort of cache file left over in my database but not sure.

Has anyone had this issue before and has a fix?

thanks for your time!

Comments

2020media’s picture

Does the localhost page display your Drupal home page? Or are you using a folder when you initially load up the page?

destinationsound’s picture

When i enter localhost/mywebistesfoldername i get the homepage. once i am there it is correctly accessing the database and all looks good. I then click any menu item link and i am brought back to the localhost page.
I hope this helps clarify the problem

how i have my website loaded is: c:/wamp/www/sonikbeats.com/drupalinstall

It works fine with a clean install of D7, just not when i use my current site.

Yikai Wang’s picture

I had a similar problem. I worked locally on one computer, when I moved everything to a new computer and solved some database problems. All my drupal links kept linking to my wamp server homepage.

I then realised that I have enabled 'clean url' in admin panel when I worked on my old computer (administration -> configuration -> search and metadata -> clean URLs). But I didn't switch on rewrite_module in my new wamp server in my new computer. That caused the problem because the server was not able to find all the 'clean url' the drupal is keep leading to.

So here is what I did: I clicked the green wamp icon, and then went to 'Apache -> Apache Modules and ticked the rewrite_module. and then refreshed the page. It worked nicely for me!

One more question: every time after you click a link in your drupal site, what are the url look like? are they end up with something like "/#overlay=admin/appearance" or something like "q?=node" ?

melissaralph’s picture

I am having problems with my urls linking back to my WAMP server, too.

I am using the Panels modules to work without regions, and those pages have ( "/#overlay=admin/appearance" or something like "q?=node" ?) in the url. Could someone please tell me how to fix it. I need to move the website off local host and into an FTP server for the actual website, but these links are worrying me.

yasha770’s picture

Great ! I had the same problem and your advice fix it.
Thank you

Morg3nstein’s picture

Thank you Yikai, had the same problem. Your solution worked perfectly. Appreciate it!

Collins405’s picture

You beauty. Kicking myself for not picking up on that sooner.

/chris

naboss’s picture

thank you so much I read what u write and i'm so happy cause what u say is worked fine
i don't understand so much what all the modules that are in apache works for but I guess one day I will look at them

thank you so much for sharing this great informations

jwol’s picture

Thanks for this, saved me from pulling out my hair.

rajkumar2000’s picture

'Apache -> Apache Modules and ticked the rewrite_module. and then refreshed the page. It worked nicely for me!

Thank you

Tulika’s picture

It really Works.

paulhudson’s picture

Just a couple of classic gotchas to check:

- You've included the .htaccess file right? Easy to miss! ;-)
- Check Clean URL's test and mod_rewrite as mentioned above.
- Try setting your RewriteBase in .htaccess
So for c:/wamp/www/sonikbeats.com/drupalinstall you might want:
RewriteBase /wamp/www/sonikbeats.com/drupalinstall

This does sound like a classic missing .htaccess though

davipilot’s picture

@drupal.co.uk

I have checked and verified each of your classic gotchas. I still have the problem where every link returns me to the Wampserver home page.

Anything else you may suggest to check?

karisbm’s picture

Hi Jason, please check to see that the line you just uncomented( RewriteBase /) reads as RewriteBase /your_folder. You should add the folder name of your project. Hope this helps

BernalCarlos’s picture

Hi. I also had the same problem, and after verifying the classic gotchas that @paulhudson mentioned. It turns out that there is another gotcha.

If your site is in a subdirectory like http://localhost/mysite, you have to do two things in your .htaccess file:

  1. Set the RewriteBase to /mysite (classic gotcha)
  2. You have to change "RewriteRule ^ index.php [L]" to "RewriteRule ^ /mysite/index.php [L]" (new gotcha)

This worked for me, and I hope this helps anybody else with the same problem.

See the "Fixing Problems" section in https://www.drupal.org/getting-started/clean-urls

himanshu94’s picture

Thanks Yikai Wang .It works fine

nityanand32’s picture

For drupal 8.x and 7.x both
Just do these steps(WAMP):
1)Go to the green icon of wamp in taskbar
2)click on Apache ---> Apache modules
3)click on rewrite_module
Refresh your web-page