0

Recently I am working on a Magento platform. I am new in this sector. In order to remove index.php from the url, I edited .htaccess file but no luck. I added the code below:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Then I found if mod_rewrite isn't enabled, then it won't work. Now I don't know how to check if mod_rewrite is enabled on the live server. Can anyone please help how I can check this?

Gamer
  • 311
  • 4
  • 17
  • Add to your question, exactly what you have tried. If you don't get any errors when you add these mod_rewrite directives then it probably is enabled already. However, if you've wrapped it in an `` container then that will hide it. Also, it's possible that `.htaccess` itself is disabled. – MrWhite Oct 04 '16 at 16:13
  • 2
    Have you tried the answers here: http://stackoverflow.com/questions/10474740/how-to-remove-index-php-from-urls ? – Jan Papenbrock Oct 04 '16 at 16:19
  • Yes, I have tried everything on that thread but no luck :( – Gamer Oct 04 '16 at 16:34
  • 1
    The code you have posted does not "remove index.php from the URL". That code is a _front controller_ pattern that routes all requests through `index.php` using an _internal rewrite_. What do your internal links look like... are you linking to `index.php`? – MrWhite Oct 04 '16 at 16:49
  • Please check the site where I am working: http://www.nakarjewelry.com/ .When you goes through any menu item, it adds index.php in the url. Just try to visit any page, you will find it. – Gamer Oct 04 '16 at 16:52
  • 1
    That is something you need to "fix" within Magento itself, not in `.htaccess`. You need to instruct Magento how to construct the URLs. (What you can use `.htaccess` for is to _redirect_ any "index.php" URLs that have already been indexed/linked to.) – MrWhite Oct 04 '16 at 18:49
  • How I can do that? Can you please help with any references? I am not a Magento developer yet. I am a Wordpress developer but learning Magento recently. – Gamer Oct 05 '16 at 16:21

0 Answers0