Magento Sub Pages Shows 404 NOT FOUND Error - php

I am using Magento 1.9.1. I installed Magento successfully in my server. But when I navigate any subpages (example:About Us, Contact Us, Login etc) in front end it shows 404 Not Found Error. But Home page display correctly.
My home page url is something like this: http://mydomain.in/store .This display ok. My Contact Us page is : http://mydomain.in/store/contacts . This shows Not Found Error. But when I type url manually like this http://mydomain.in/store/index.php/contacts .This shows working. That is when adding index.php it became working.
How can I make this working??
Solutions I found: Change 'Use Web Server Rewrites' to NO in System->Configuration->Web->Search Engine Optimization.
This make working, but the url contain index.php like this http://mydomain.in/store/index.php/contacts. I think http://mydomain.in/store/contacts is standard and this should work(but I don't know how). Another issue is User Logging, checkout etc are not working here. To make working we can add form key in corresponding pages. But this is not preferable because many pages have to change.
Another solution is: make enable apache mod rewrite. Uncomment this line LoadModule 'rewrite_module modules/mod_rewrite.so' inside 'wamp\bin\apache\apache2.4.9\conf\httpd.conf'.
My question is How to avoid 404 NOT FOUND ERROR in Magento Subpages?
When I follow the above solutions the url path contain index.php. And the logging like features become not working.
How can I avoid index.php in url?
My folder structure is D:\wamp\apache2\htdocs\site\store. store folder contain magento files.
The home page is available in http://mydomain.in/store.
Please help me .Any help is really appreciable..

In order to avoid index.php in urls you must have mod_rewrite enabled on your server and from the Magento admin panel go to System->conguration->web->Search Engines Optimization and set the flag Use Web Server Rewrites to Yes. Clear the cache and give it a go.

Related

Openshift PHP7 wordpress app throws “404 Page not found error” with custom domain name

I have a wordpress app based on PHP7 catridge on Openshift. I added two alias to the app(e.g, www.xyz.com & xyz.com) and I also updated the CName in my Zone file. When I enter www.xyz.com, it redirects me to www.xyz.com/app and throws a 404 NOT FOUND error (nginx/1.11.6).
But I can access the administration page without any problem (www.xyz.com/wp-admin)
Can anyone please help?
Enter the www.domain.abc first. Use CloudFlare to configure your domain. Make things pretty easy.
After this you will get the pretty permalinks error related to ngnix.
I am too getting the same error. I can access the home page and most of the things. This error only arises when I decide to use Pretty Permalinks in WordPress.
Till now I have figured it out that we have to edit the ngnix file. But there are several files out there.
Has made me even more confused.
This may not be the solution but you can access post and other stuff in plain permalinks.

Incorrectly Changing WordPress URLs on Same Server

So we have a dedicated server and we installed a single instance of Wordpress on this URL (using URL as example): AnytownBoatTours.com. Started themes and plugins etc... and the owner said the URL needs to be the other way around: BoatToursAnytown.com.
So, we pointed the new domain to existing instance of WordPress (since they are on the same dedicated server), and then I followed wordpress instructions by going into Settings -> General and changed both the Wordpress Address (URL) and Site Address (URL) to BoatToursAnytown.com (with no "/" at ending on either).
So, everything appears to be fine. The Wordpress site seems to have accepted the URL change and I've logged in and made changes to the home page and theme. Then I came across a weird error with sub pages I'd created before the switch. The error occurs in all pages except the home page. When I click on any of the pages except home and edit them, when I hit update or preview buttons, the preview goes to a 404 message. I thought that is weird so I started looking around.
I discovered that the content directory is still pointing back to the old URL. The Wp-config Location is: D:\Websites\AnytownBoatTours.com/wp-config.php and the Content Directory is: D:\Websites\AnytownBoatTours.com/wp-content
So obviously the change in General Settings didn't work. I was hoping someone could help me figure how to go from here.
Thank you
Update your permalinks even if it's not changing them, you just need to click the save. Settings > Permalinks and press Save Changes. This will more then likely fix the issue as I had to do it when I recently migrated a clients site.

Change Base link of website using .htaccess file

can editing .htaccess file. Base address of site for all link on home page will changed?
scenario:My osclass hosted at openshift cloud with url http://myappdomain.rhcloud.com After adding alias at server side i am using www.mydomain.com with forwarding masking feature.Everyting is fine for home page.But poblem is when user click on any link on website.Browser URL field change from www.mydomain.com to http://myappdomain.rhcloud.com/link instead of www.mydoamin.com/link.but if user manually type www.mydomain.com/link it works and it remain same not changing to http://myappdomain.rhcloud.com/link in browser URL. Hover over links also show http://myappdomain.rhcloud.com/link not www.mydomain.com/link
i even try to edit config.php file
define('WEB_PATH', 'http://www.mydomain.com/');
but it is not working. my point is can this acheive with editing .htaccess file with minimal effect or there some other way. Have anyone try openshift for osclass before with custom domain? wordpress and osclass are quite similar in architecture.Have wordpress users on openshift face such problem?
Please note that .htaccess only changes the way server handles visitor's request. It does not change the contents in your web site. Therefore, you can never change your "hover result" with .htaccess settings.
I think that depends on how the links are generated in your website:
If the links are stored along with HTML in database, you'd need to change it with database query. If you're using MySQL, please learn your database structure and form a correct REPLACE query.
If the links are generated on-load, please make sure you flush all the caches. Cache may not know that your WEB_PATH has changed.

Unable to set up pagelime with a codeigniter site

I'm trying to setup pagelime to work with a codeigniter site of mine and it looks like I have everything setup because I can view and edit the site in pagelime, but when I publish the page that i've edited, it says successfuly, but if I go to the webpage, it doesn't contain any of the changes that i just made.
I'm guessing it might have to do with the way that codeigniter url's work because when setting up the site, it asks for the url+index page. I tried setting my index page to http://example.com/index.php/controller/index but pagelime always adds index.php to your url so it looks like this - http://example.com/index.php/controller/index/index.php.
Has anyone setup a codeigniter site on pagelime successfully and can help me with this issue?
I have and the way that pagelime works it will not work with a CI framework since as you have found out, pagelime is setup for standard websites. ie: all pages are in the root and subpages follow the link structure so a link to homepage.com/pictures/album1 should be in the root of the ftp then in the pictures folder and to the album1 whereas we know that the pictures "folder" is nothing more than a controller. I hope that I explained that right or that you can decode what i was trying to say there.
First, make sure to add extensions to your routes in the .htaccess file:
Codeigniter Routes for filename with extension
In Pagelime, you can set each page to have an FTP Publish Target in the page properties screen. Set the target to the URL of your view, and you should be good to go.
Hope that helps!

Help with Clean URLs

I am very new to php (in fact about 2 days old). After getting ripped off by my last webhost I have decided to move my website to a different host. A friend has been helping me do this as he has a little info but we are now stuck and I have tried finding a soloution on google but most answers are way over my head. My site is a php site with a mysql database. We have moved the database and ftp'd the site and everything is now working on the new server except one thing - my site was designed originally to use clean urls? When I go to my shop page (ie: mywebsite.com and click on the shop link - mywebsite.com/shop/ (shows in the bottom left of my browser) I get a page not found error, yet when I type in the url mywebsite.com/shop.php the page displays fine. In addition, if I go to mywebsite.com/shop/shoes/ (another link which shows the preceding link in the bottom left hand corner) I get a page not found error. Also if I type in mywebsite.com/shop/shoes.php in the address bar I also get a page not found error even though the page shoes.php exists on the ftp server in a folder called templates - if I go to mywebsite.com/templates/shoes.php it shows up) I understand this is called clean urls and I need to add an .htaccess file to sort out the issue. I have looked on the ftp area of my old host and cannot find this file but have been told it is probably hidden. I have been told by my new provider that mod-rewrite is available on the server but I have no idea how to write this htaccess file. Can anyone please give me a step by step on how to do this as I am not a coder.
Additional Details
I have the following files in my root directory: index.php, shop.php, checkout.php, completed.php, contact.php ... I then have a folder called templates and in this folder I have: shoes.php. clothes.php, coats.php ...
The issue I am having is that most of the php files in my root directory already have href-links? pointing to places like mysite.com/shop/ and mysite.com/shop/shoes/ so when I open up the home page in my browser and hover over the links these are the addresses I see and when I click on the links I get page not found as the borwser must be looking for the links in the wrong place. (these links worked fine however on the last host I used). I understand I need an htaccess file to re-direct these links to the correct places. - ie the link for mysite.com/shop/shoes/ is actually linking to a page called shoes.php located in root/templates. I understand this method was used to tidy up the urls?? ie: instead of having mysite.com/templates/shoes.php the urls shows mysite.com/shop/shoes/. I have looked at the code within some of the php pages in the root and they all have lots of links to these 'false' addresses - ie: mysite.com/shop/shoes/ when the actual file should be at mysite.com/templates/shoes.php. I don't want to go through each file one at a time as they are hundreds of links, thus the reason for trying to make this htaccess file. Thanks for your time, Dave
Try to find an option on your FTP client software to show hidden files.
The name of this file is .htaccess (dot htaccess), that is probably the reason you're not seeing it. If the old site is working then the file is probably there. You could also contact somebody to send you the file via e-mail, IM, etc.
You do not need mod_rewrite or .htaccess for this.
Turn on multiviews in your Apache configuration. This will allow you to omit the .php extension from your URLs.

Categories