1

magento inner page(category link , product page and others etc . ) not working , redirect to 404 page ? Only home page is working.

My Links Are

http://localhost/magento/men.html
http://localhost/magento/men/new-arrivals.html
http://localhost/magento/tori-tank-586.html

In admin

  • Use Web Server Rewrites --> Yes
  • Use Secure URLs in Frontend --> Yes

Below is my .htaccess file

<IfModule mod_rewrite.c>

############################################
## enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

############################################
## you can put here your magento root folder
## path relative to web root

    RewriteBase /magento/

############################################
## uncomment next line to enable light API calls processing

#    RewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]

############################################
## rewrite API2 calls to api.php (by now it is REST only)

    RewriteRule ^api/rest api.php?type=rest [QSA,L]

############################################
## workaround for HTTP authorization
## in CGI environment

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

############################################
## TRACE and TRACK HTTP methods disabled to prevent XSS attacks

    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]

############################################
## redirect for mobile user agents

    #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
    #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
    #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

############################################
## never rewrite for existing files, directories and links

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l

############################################
## rewrite everything else to index.php

    RewriteRule .* index.php [L]

</IfModule>
2
  • Try index management . After that clear cache
    – Nikhil_K_R
    Jun 9, 2014 at 9:07
  • i have also try that. tried reindexing and Refresh cache management. Jun 9, 2014 at 12:20

6 Answers 6

2

If you are able to access inner page like http://localhost/magento/index.php/men/new-arrivals.html. If yes,then try to enable apache rewrite module and then restart the server and check again.

0
1

Replace your .htaccess with a default one form a fresh installation. Clear the cache and session. You are good to go...!

1
  • I done the same but still not working. if there is any folder or file permission then let me what permission of files and folder that i have to give? Jun 9, 2014 at 12:17
1

i found the solution .

Open this file /etc/apache2/site-available/default

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

Also the above changes also required.

/etc/apache2/apache2.conf

<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>

Restart Apache

sudo service apache2 restart

0

Replace RewriteBase /magento/ with RewriteBase / in your htaccess file. and clear cache.

7
  • just check localhost/magento/index.php/men/new-arrivals.html working for you? Jun 9, 2014 at 12:24
  • yes. it works. if i am added index.php before any url for category or product then it will other wise it wil not works. Jun 9, 2014 at 12:29
  • i am working on ubuntu and i have made some permission chages in my folder system. i thik this is the reason. but i don't know the acutal file permission. Jun 9, 2014 at 12:41
  • i think some server mod rewrite issue then. Jun 9, 2014 at 12:57
  • mod_rewrite also loaded. Jun 9, 2014 at 12:59
0

On the local server please enable the rewrite_module according to the attached screenshot. Hope it will resolve your problem. https://i.stack.imgur.com/M2ix2.jpg

0

It happened with me as well. There can be 2 issues with this:

1) Your server is not giving you mod_rewrite access . For that just go to your server installation(if local) and in apache then conf(for xampp). There you will find a httpd file. In that find 'LoadModule rewrite_module modules/mod_rewrite.so' . This might change depending upon your php version. If that is commented just uncomment it(by removing # ). If it is already uncommented this is not the issue.

2) Now you don't have your htaccess files, as in some cases it is in ignore state in git repo. So just go to your working folder of magento and copy paste all the .htaccess files to your new folder. Restart your server and it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.