This is a discussion on "Mod_rewrite ???" within the PHP Forum section. This forum, and the thread "Mod_rewrite ??? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Mod_rewrite ???
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Mod_rewrite ???
How the hell do you get mod_rewrite to work? it's just not happening for me.
I tried this:
Can anyone tell me what I'm doing wrong? BTW the .htaccess file is in the /blog/ directory |
|
|
|
|||
|
Re: Mod_rewrite ???
If you just use ([0-9][0-9]) you are limiting the mod_rewrite to a two digit number. Have you checked that mod_rewrite is enabled on your server? |
|
||||
|
Re: Mod_rewrite ???
You've got the hang of mod_rewrite, what you need is to get comfy with regular expressions. here's a good website: http://www.regular-expressions.info/.
As for this... http://www.theloop.org.uk/blog/blog.php?article_id=30 to http://www.theloop.org.uk/blog/30/ ... I think you need this... RewriteRule ^/blog/([0-9]+)/?$ /blog.php?article_id=$1 ...which should take care of... /blog/3 /blog/30 /blog/3/ /blog/30/
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
|||
|
Re: Mod_rewrite ???
They don't seem to work
I tried a few combinations but all I get is page not found. I know PHP is loading the mod_wrote module as well. I checked in php info. do you think it's something to do with this? "need to enable mod_rewrite and the FileInfo override in their httpd.conf file" |
|
|||
|
Re: Mod_rewrite ???
Try this in your website's base directory.
|
|
|||
|
Re: Mod_rewrite ???
Yes! Got it working. Played about with it for a bit and finally got it going.
Thanks a lot guys. check it out at www.theloop.org.uk/blog does it work for you too? |
|
|||
|
Re: Mod_rewrite ???
Quote:
What did you do to get it working? |
|
|||
|
Re: Mod_rewrite ???
I simplified the rewrite rule to make it work at a really low level. e.g. switching between to .html files.
Then started working up the expression from there. I added some directory's and stuff and eventually it just worked, I'm using the same rule I had in the first place as well which is really strange. Just glad it works! |
![]() |
| Tags |
| help, mod_rewrite |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mod_Rewrite Request | swiftmed | PHP Forum | 5 | Jun 10th, 2006 06:05 |
| Help with Mod_Rewrite | swiftmed | Web Page Design | 3 | Jun 7th, 2006 22:17 |