Tag Info

New answers tagged

1

You need to use the QSA flag on your rewrite rule. It preserves any query string from the original URL and appends it to the new URL. Your rewrite rule would be: RewriteRule ^(|/)$ index.php?url=$1 [QSA] RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ index.php?url=$1 [QSA]


3

You can push data to analytics on search results site loading that way: analytics.js: ga('send', 'pageview', '/search_results.php?search='+make+' - '+model+' - '+year); But you need to get GET params from URL. Example: function get(key_str) { if(window.location.search) { var query = window.location.search.substr(1); var pairs = ...


0

The default installation of Piwik includes a plugin that can help you generate just such data. I've never used it specifically as I run it on production sites, but it is there.


1

So after some trial and error I came up with a working solution that I'm not quite happy with. But at least it works. Since all "real" images are located in /includes/ or subdirectories I simply rewrote the rule for the images. So this location ~* \.(?:gif|jpe?g|png|ico)$ { expires 168h; add_header Pragma public; add_header Cache-Control ...


1

Performance and reliability are very important factors for SEO, therefore the idea of defering the page load seems to be counter productive in terms of SEO at least. Having said that however, provided your initial page response is relatively quick and includes a version of the content, even if not the latest, then you should be ok. Perhaps one of these ...


2

I think the approach here should depend on the nature and timing of the traffic: If you are expecting a curve increase with traffic spread throughout the day then 70000 hits/day works out at just less than 1 hit per second, and with a page processing time of around 5ms this should be no trouble at all. If instead you are expecting a spike increase with the ...


1

To use safe_mode, set your database host, username and password in php.ini using the configuration parameters: sql.safe_mode = On mysqli.default_host = "127.0.0.1" mysqli.default_port = "3306" mysqli.default_user = "root" mysqli.default_pw = "Password123" By having it configured there you will not need it in your PHP scripts - enabling you to update your ...


0

It is possible to take screenshots programatically rather than manually. I do this on my charts and graphs site. The graphs are generated client side using JavaScript but I need thumbnail images created from them. I'm using Java instead of PHP, but it should be similar. Install xvfb (X virtual frame buffer) so that Firefox can run on a headless ...


-1

If you know the path to your log file and the path to the file in which the function calling fopen, then u can use $filename = __DIR__ . "relative file path to your log file from called file" Hope this helps


1

From my understanding and experience it seems to me perhaps you've misunderstood how CDN caching works: From the example you've given, the CDN would not ask your web-server when the file was last modified because you've already told it that the file has expired and will therefore need to be re-fetched anyway. Web browsers will only send an ...


10

You can encode your code using ionCube and similar products. Your client won't be able to view, study or take it. However, everything can be reverse engineered meaning that, no matter how you encode your code, it can be decoded. For example, ionCube can be decoded with decry.pt. It works, I can confirm it. So you'll never be able to really secure your code ...


2

The actual answer is no you can't! Sure there many things to simulate it. But think of the user uses the other persons computer/account or even browser! You can modify local IP addresses, cookies, http-headers, java-applets or all other clientside things. Most sites who want this has limits of accounts per IP-address. You also may try to filter the ...


0

You should keep in mind that a 304 Not Modified header still requires a request going through to your server. You properly won't want to send 304 Not Modified headers, you most like want to send a cache expire header, so that the browser doesn't even try to request the resources again. That of course only relevant for static resources (images, scripts ...


1

webpagetest.org tests reflect a user loading a page in a web browser - the results can vary from time to time for many reasons that will be out of your control. Following their tips will help you to improve this, though I would strongly recommend carefully thinking about when and how you load javascripts to reduce TTFB. Read more: Feed the Bot: PageSpeed ...


1

I believe the problem here is not likely to be related to your Apache configuration but in your PHP script. For example, if your script loads the entire video file in one go, and then sends it all to the browser in one go this can cause this issue: <?php header( 'Content-Type: video/mp4' ); $sVideo = @file_get_contents( ...


1

The range header handling code is probably where the issue lies, although it's hard to say for sure. Serving videos with PHP tends not to be very memory efficient, particularly if they are large. I'd suggest you use something like X-Sendfile instead. That way, you still do your authentication checks in PHP, but you get your web server to do the heavy lifting ...



Top 50 recent answers are included