Jump to content


Photo

mod_rewrite not affect to my link

mod_rewrite

  • This topic is locked This topic is locked
6 replies to this topic

#1 catalankh

catalankh

    Newbie

  • New Members
  • Pip
  • 6 posts

Posted 08 January 2013 - 03:12 PM

my mod_rewrite is not affect to my link why?
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} news/
RewriteCond %{REQUEST_URI} tips/
RewriteCond %{REQUEST_URI} views/
RewriteRule news/ menu.php?ph_sc_menu_id=1 [L]
RewriteRule tips/ menu.php?ph_sc_menu_id=2 [L]
RewriteRule views/ menu.php?ph_sc_menu_id=3 [L]

if i key on my url box it working but when i click my navigation menu it still display menu.php?ph_sc_menu_id=3

#2 cpd

cpd

    ¬_¬

  • Members
  • PipPipPip
  • 881 posts
  • LocationLondon, UK

Posted 08 January 2013 - 03:19 PM

That's not how you should be using mod_rewrite. You can't define every link and every possible bit of GET data, that's just crazy. Go an have a read on what it should be used for and then how to use it.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."

"One of my most productive days was throwing away 1000 lines of code."

#3 catalankh

catalankh

    Newbie

  • New Members
  • Pip
  • 6 posts

Posted 09 January 2013 - 12:45 PM

though to i write like that it not worke too

RewriteEngine On
RewriteRule ^menu/([0-9]+) menu.php?ph_sc_menu_id=$1

what's going on?

#4 cpd

cpd

    ¬_¬

  • Members
  • PipPipPip
  • 881 posts
  • LocationLondon, UK

Posted 09 January 2013 - 02:06 PM

I have no idea what the hell that post is meant to mean...
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."

"One of my most productive days was throwing away 1000 lines of code."

#5 gizmola

gizmola

    Advanced Member

  • Administrators
  • 4,069 posts
  • LocationLos Angeles, CA USA

Posted 10 January 2013 - 12:06 AM

mod_rewrite rewrites requests. In other words, when people use a browser and type in a url, mod_rewrite can be used to modify that to something different inside Apache.

It does not *change the html your script sends back*. If you want your urls to be displayed in a particular format, you must render them in that format.

#6 catalankh

catalankh

    Newbie

  • New Members
  • Pip
  • 6 posts

Posted 20 January 2013 - 01:04 AM

cpd what the fucking going on with you why you always reply with hell worthless answer if you don't know or understand my question keep silent no one said you're blind or dump dam stupid

#7 cpd

cpd

    ¬_¬

  • Members
  • PipPipPip
  • 881 posts
  • LocationLondon, UK

Posted 20 January 2013 - 05:50 AM

I don't always give bad, incomplete or pointless answer. My first post made a point, explained why and told you where to go and correct it (through google) because explaining every little details is silly on here when its been done a million other times by other people. My second post clearly indicates you're posts don't make sense which may be why you have little responses. Gizmola hasn't directly answered your question but instead gone on a tangent explaining in brief what mod_rewrite is for; this is what I told you to lookup in my first post.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."

"One of my most productive days was throwing away 1000 lines of code."




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com