Yatin Mistry Yatin Mistry - 7 months ago 89
PHP Question

magento inner page not working , redirect to 404 page?

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>

Answer

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

Comments