The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> System Administration
> Apache Development
|
Simple mod-rewrite (get-url)
Discuss Simple mod-rewrite (get-url) in the Apache Development forum on Dev Shed. Simple mod-rewrite (get-url) Apache Development forum discussing HTTP Server general topics, configuration, and modules. Apache is an open source web server that runs on multiple platforms.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 14th, 2013, 01:24 PM
|
 |
Contributing User
|
|
Join Date: Sep 2012
Posts: 168
Time spent in forums: 20 h 30 m 23 sec
Reputation Power: 1
|
|
|
Simple mod-rewrite (get-url)
Hi!
i've been trying to get
http://notflip.be/meetup/meeting.php?m=1
to
http://notflip.be/meetup/1
but none of the rewrite's seem to work.
Anyone knows's the solution? thanks!
|

January 14th, 2013, 01:50 PM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
|
What have you tried?
|

January 15th, 2013, 02:20 AM
|
 |
Contributing User
|
|
Join Date: Sep 2012
Posts: 168
Time spent in forums: 20 h 30 m 23 sec
Reputation Power: 1
|
|
Quote: | Originally Posted by requinix What have you tried? |
I tried the following, and variations on it. no result
Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^meeting/([^/]*)$ /meeting.php?m=$1 [L]
|

January 15th, 2013, 03:04 AM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
|
I can't help but notice the discrepancy between the "meetup" you said and the "meeting" in your code.
|

January 15th, 2013, 03:21 AM
|
 |
Contributing User
|
|
Join Date: Sep 2012
Posts: 168
Time spent in forums: 20 h 30 m 23 sec
Reputation Power: 1
|
|
Quote: | Originally Posted by requinix I can't help but notice the discrepancy between the "meetup" you said and the "meeting" in your code. |
Ok but still. it should say http://notflip.be/meeting/ then no? damn this is hard.. am i on the right track?
|

January 15th, 2013, 03:39 AM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
|
Oh, and you say /meetup.php. (1) Drop the slash and (2) you said it should go to meeting/meeting.php.
|

January 15th, 2013, 03:50 AM
|
 |
Contributing User
|
|
Join Date: Sep 2012
Posts: 168
Time spent in forums: 20 h 30 m 23 sec
Reputation Power: 1
|
|
Quote: | Originally Posted by requinix Oh, and you say /meetup.php. (1) Drop the slash and (2) you said it should go to meeting/meeting.php. |
Pf i don't get it. so the syntax is . rewriterule (whatitneedstobe) (condition) right?
|

January 16th, 2013, 03:16 AM
|
 |
Contributing User
|
|
Join Date: Sep 2012
Posts: 168
Time spent in forums: 20 h 30 m 23 sec
Reputation Power: 1
|
|
I tried this.. it's working for now. although i needed to absolute-path all my images and css.
but when i click on another link it just add's it to the url as following
/meetup/meeting/1
/meetup/meeting/meeting/1
/meetup/meeting/meeting/1
and so on.. this is my code.
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^meeting/([0-9]+)/?$ meeting.php?m=$1 [NC,L]
thanks!
|

January 16th, 2013, 12:14 PM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
Quote: | Originally Posted by notflip so the syntax is . rewriterule (whatitneedstobe) (condition) right? |
Right. But the main problem was how you described one thing and then had your rewriting do another thing.
Quote: | Originally Posted by notflip but when i click on another link it just add's it to the url as following |
Those links need to be absolute too.
|

January 16th, 2013, 12:36 PM
|
 |
Contributing User
|
|
Join Date: Sep 2012
Posts: 168
Time spent in forums: 20 h 30 m 23 sec
Reputation Power: 1
|
|
Quote: | Originally Posted by requinix Right. But the main problem was how you described one thing and then had your rewriting do another thing.
Those links need to be absolute too. |
Didn't know rewriting was that much misery. you basicly have to rewrite all the links on your site? .. 
|

January 16th, 2013, 02:25 PM
|
 |
Still alive
|
|
Join Date: Mar 2007
Location: Washington, USA
|
|
|
mod_rewrite doesn't fix the links you send to browsers. It allows you to use something more creative but you still need to tell the browsers about the new URLs yourself.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|