URL rewrites do not work after moving Magento installation to new server - magento

After duplicating our web store onto a new server, copying the database over and changing the base url/safe base url in the db, all we get from the copied installation is the front page. That is, no custom url redirects work (for products, the admin panel, etc.), they all result in a 404 (and not the magento 404, the server default). Do you have any ideas what I could check out? Could there be an issue with one of the libraries included in magento?
I tried reindexing with /shell/indexer.php - which executed successfully but didn't fix the redirects.
Any ideas? Note I cannot access the admin panel via /admin because of this issue.
Edit: solution was .htaccess file missing in root directory
I added the sample htaccess file from the magento installation (I uploaded a copy in case someone finds it useful: http://sdrv.ms/13mw8Ok), and mod_rewrite was activated the next time I visited the site.

Make sure your vhosts file is setup correctly to allow mod_rewrite
Make sure your .htaccess file is setup correctly
How to enable mod_rewrite for Apache 2.2
You can access your admin through /index.php/admin in the meanwhile.

Related

Magento Use Web Server Rewrites in Multi Domain Setup

I have to two stores each having different domain. They are hosted on dedicated server with SuExec disabled. I have copied the .htaccess and index.php and everything works fine.
The problem I am having is with my 2nd store Web Server Rewrites. As soon I enabled this for the 2nd store which is using symbolic link to the root directory, it starts giving page not found error.
domain2.com/index.php/abc.html ----- Works Fine with Use Web Server Rewrites Turned Off
domain2.com/abc.html ----- Does not work with Use Web Server Rewrites Turned ON
The base store works without any problem.
Any help is much appreciated.
Farrukh Khan
-> Flush The Magento Cache
Goto System->Cache Management
Refresh the catalog rewrites
Goto All Cache and change drop down to Refresh.
Click save
On most server, this should take out the index.php in your URL’s.
If you are getting a 404 error, continue reading.
-> Fixed Mode_Rewrite Errors
Please check you webserver configuration.
Do you use Apache? Maybe there is something like "AllowOverride none" in your configuration which disables .htaccess-files (the .htaccess-file in your magento-root-directory defines the rewrite-rules).
The most common cause for this is that you have an incorrect .htaccess file in your ftp.
Goto the magentocommerce.com site and download the magento files again.
Extract the files, and ONLY upload the .htaccess file to your Magento root directory.
This should fix any problems related to enabling the use of web server rewrites in Magento.
I was facing the same problem above, but now i solved already. The main reason for that problem is .htaccess file. By replacing .htaccess file with magento default .htaccess file solve all the problem. Web Server Rewrites Turned on or off, you can do as you like.
After saving the configuration, don't forget to clear cache.

magento category url,admin 404 error

I am a magento newbie.
I've observed that when I make an installation of magento by copying all contents of the extraction directly to localhost.... i.e (when app, media, skin, index.php etc all pasted directly in localhost) I am unable to access the admin by simply typing in localhost/admin.
Whereas I have to type in localhost/index.php/admin to get into the admin panel.
Also when i click on any category i have the same problem.
I have to append index.php/ before the category name to get the category link working.
Can anyone please tell me how to get them working.
Check your Base URL in the Admin Panel, go to System | Configuration | Web and make sure the Secure and Unsecure Base URL does not include the 'index.php' part.
If you do not have index.php in my secure or unsecure web configuration and this happening on front end and back end, try to enable url rewrites and see if that solves it. You need mod_rewrite enabled on your localhost.
What is your local server?

Magento index page loads but 404 errors on all others

Currently I am struggling with the categories and products showing 404 errors when I navigate away from the working home page.
I was able to install Magento and I am using a copy of an existing working site. The purpose is to use this new site as my dev sandbox. I am using Magento 1.11. This is also a multiple store site.
Things I have tried:
Reindex the Catalog URL Rewrite, this unfortunately never completes.
To try and solve this I have deleted all the lock files and then I have also deleted all the entries in the core_url_rewrite table.
I have also changed the Base URL in the core_config_data table to my new URL.
Thank you in advance!
Just like Fiasco Labs said, you probably turned on URL Rewriting:
System -> Configuration -> General -> Web -> Search Engine Optimizations -> Use Server Rewrites but don't have mod_rewrite Installed/Enabled.
Either Install/Enable it on your host, or just turn the server rewrites off.
Another reason, if you HAVE mod_rewrite Installed/Enabled, you might be missing .htaccess file in your Magento root.
even with mod_rewrite enabled, the error can be a misconfiguration of apache. Have a look at etc/httpd/conf/httpd.conf file. Find the part where is defined (standard Apache config dir). You should find:
AllowOverride All
If there is a
AllowOverride None
Change it to All and the magic happens. Then restart Apache with:
sudo service httpd restart

Magento not using appropriate URL - 404 Page not found

I have a magento site running locally using WAMP and it works great. However I need to create a different site so I created a folder for this new site under htdocs.
In that folder I loaded the Magento files.
Created a new database for newsite with all rights in phpmyadmin.
Went to the localhost:8888/newsite and started Magento installation wizard.
In the configuration section of the wizard I entered all the info required: db name, user, password. For URL Base I used the default (http://localhost:8888/newsite). Selected allow charts and Allow apache rewrites. Finished installing magento.
Now magento is running on newsite. I can see the front and back-end of the site.
Here is the problem: When I create a category and/or subcategory, magento does create the menu link but when I click any category, the browser takes me to a 404 not found. Upon analyzing the URL that took me there i see that the URL is : http://localhost:8888/newsite/category.html BUT by adding "index.php" into the URL (http://localhost:8888/newsite/index.php/category.html , the page does work!
So this means magento IS creating the page for the category but the linking is somewhat wrong.
Now, I've been making sure that rewrite is enabled and after all, the other site I mentioned I have is working properly, so I assume rewrite is properly enabled.
So I need help finding:
Why is one site working and the other isn't?
How can I fix this issue?
Thank you!
Sounds like you haven't copied over the .htaccess file (in your Magento root folder). You need this file for the Apache rewrites to work.

Moved Joomla 1.7 Site to New Server. Admin works fine. No pages display

I've just moved a Joomla 1.7 site to a new server.
Administration back-end works fine. Configuration.php seems fine. Get "The requested document was not found on this server." for every page other than Home.
Must be talking to the database OK or I'd get an error. Could this be a problem with the PHP?
Thanks,
Andy
Did you clear joomla cache ?
Disable page and/or module caching.
Disable any plugin that optimizes "loading speed".
Try removing SEF URLs (Joomla! and any 3rd party extension).
If you are using a custom .htacess, then use an unmodified joomla one.
Disable some system plugins.
Disable modules in the homepage.
Have you tried using another template (site) ?
You have Seach Engine Friendly URLs enabled in /administrator/ area's global configuration settings. You have probably enabled the option to use the mod_rewrite function which removes the /index.php/ portion of the urls.
It is a requirement of this mode that you have the .htaccess file in place in the root of your site. You probably had this correctly configured on your development server but perhaps forgot to move the file across when you went live. Some FTP programs hide dot files (files starting with a leading dot in the filename) so depending upon how you transferred the files (I'm guessing manually with FTP rather than Akeeba backup or similar) the file may have been missed. Look through your FTP client's options/preferences for an option to show/hide hidden files.
Failing this - the file could be correctly in place - but if you were developing in a sub-folder on your development server you would have set the RewriteBase line to your /sub-folder/
RewriteBase /sub-folder/
Now you've moved to the live server this line could be incorrect. If this is the case, edit the file to Read
RewriteBase /
Chances are it is one or other of these issues - missing .htaccess file or incorrect RewriteBase. A third and nowadays somewhat more unlikely option is that your server doesn't have mod_rewrite enabled - but I think that would result in server 500 errors.
Check whether you are using any modules that is calling database and you have not changed DB details in that module after migration. If admin panel is working fine then I think problem with some modules that are used in front-end. You can do debugging by disabling few suspected modules and check whether your site works fine or not. Else provide some more information about your site so that I can check further.

Resources