0

I had this requirement:

Remove directory /new / from the url: mysite/new/ and the site is built with Magento.

I read all necessary articles over here and over other sites.did all kind of configurations starting from

  1. Changed the url from admin panel->System->Configuration->Web->Secure and unSecure url.

    Changed Use Web Server Rewrites under Search Engine optimizations from "NO" to "YES". After i have Reindexed Data -Catalog URL Rewrites - from System-> Index Management.

Added some code in my .htaccess file

RewriteRule . /index.php [L]

as well i tried with

RewriteRule ^(.*)$ index.php?/$1 [L] (both cases later didnt work)

As well I have cleared the Cache and sessions... I wasnt able to remove that directory + my site was down. I got back the site after i did an undo of my actions. and here i am facing something else: My links now have index.php inside the url.

mydomain/new/index.php/xxxxxxxxx.html 

My client used to post on facebook its articles and they have

old url : mydomain/new/xxxxxxxxxxxx.html

So i have to remove the index.php again. but i cant do that,my site goes down again.

What am i missing over here? After i read some comments about my issue in Stack Overflow. i did another change in my .htaccess file RewriteRule ^index.php/(.+)$ http://yourdomain.com/$1 [R=301,L] and than i noticed that my site is slow. Overwrited an original file of my .htaccess and still the site is so slow . takes about 40 sec to open . What can i do now. Performance is more important now than index.php removal.

2
  • Check with chrome developer tools in the network tab how many redirects you have when you go to your home page. Althought I dont think this is the cause of the performance issue. If you reindex then is possible that your cache was also flashed? This could explain why the site is slow, but once the cache is regenerated it should be ok again
    – lloiacono
    Commented Jun 27, 2015 at 7:56
  • i regenerated cache right now... nothing changes same history
    – Old Crew
    Commented Jun 27, 2015 at 8:02

2 Answers 2

1

Enabling/disabling rewrite rules won't change performance at all. The difference truly is negligible.

You need to profile your code to determine what your performance bottleneck is.

Start by installing a fresh Magento demo store with sample data, and if your TTFB with all caches off are greater than 0.7s - then your hosting is the issue, if the TTFB (with all caches off) is lower than 0.7s - then your store itself is the issue.


For your .htaccess, just stick to the defaults,

Eg. https://raw.githubusercontent.com/sonassi/magento-ce/1.9.1.0/.htaccess

RewriteBase /magento/

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

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

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

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

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

RewriteRule .* index.php [L]
-1

I solved this performance issue by truncating core_url_rewrite table.

0

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.