Mod-rewrite question issue all do read this !

Started on the old forum in February 2014 · view the original in the archive · old links redirect here

No replies · 240 views · started 12 years ago · 1 min read

just_m3. Developer · 199 posts #1

Hellow to all

I Recently have runned into a issue add+1 in a php file which is accessed by mod-rewrite rulles .

The problem ?

1st . On server the file is accessed twice . 2nd. Can't find any way / method to stop it !!

I even tried to match url parts with preg match $_SERVER['REQUEST_URI'] and see if its accessed by rewrite , it didn't worked.

Issue ? two requests are sent to the server when i access the script on rewrited url , so there it goes +1 +1 ;

and on single url file.php?id=1 update table adds +1 which is normal !

ANY WAY TO FIX THIS ? AND ADD +1 ONLY ? on two requests ?

Added after 32 minutes:

just_m3. wrote: hellow to all

i recently have runned into a issue add+1 in a php file which is accessed by mod-rewrite rulles .

The problem ?

1st . On server the file is accessed twice . 2nd. Can't find any way / method to stop it !!

I even tried to match url parts with preg match $_server['request_uri'] and see if its accessed by rewrite , it didn't worked.

Issue ? Two requests are sent to the server when i access the script on rewrited url , so there it goes +1 +1 ;

and on single url file.php?id=1 update table adds +1 which is normal !

Any way to fix this ? And add +1 only ? On two requests ?

take notice !

found the issue , i was including a javascript by path method not by url which was requested from the same url with id settup , so there you go 2 requests one for page 2nd for loading script ... Good to be known !

http://domain.tld/view/24/(24)_Program_Benefiting_Some_Immigrants_Extends_Visa_Wait_for_Others

javascript load request 

http://domain.tld/view/24/scripts/bbcode.js

This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close