Sign in to follow this  
Mathachew

[web] URL Rewrite, The complexities of a beautiful feature

Recommended Posts

I'm trying to get Apache's URL rewrite working on my server and can't seem to get a grasp on the problem. Here's what I've got, which I'm sure isn't right:
<IfModule mod_rewrite.c>
        RewriteEngine On

        RewriteLog "/var/www/rewrite.log"
        RewriteRule ^(.*)$ index.php?m=$1 [L,QSA]
</IfModule>
I want to redirect anything after / through index.php. My internal code will automatically determine what page will be shown. Well, this isn't working. I get a 404 error. Any help would be great :)

Share this post


Link to post
Share on other sites
actually, now that I've tried something else, my URLs throughout the site could get screwed up... Just about every link has a url like this:

?m=blah&id=10

Having a url like: http://whatever.com/home will force the above link to go here:

http://whatever.com/home/?m=blah&id=10

Which isn't right. So maybe URL rewrite isn't what I want. How about a url redirect of sorts?

Share this post


Link to post
Share on other sites
Oluseyi, thanks for the reply, but that doesn't appear to perform what I'm looking for. I've now flip-flopped. I do need to use URL Rewrite. My URLs don't have / in front of them, so adding them will fix the path issue. The issue I'm having now is that I'm trying to test a known working URL rewrite method on my Ubuntu server, but it's not working. URL Rewrite is installed and as far as I can tell, should be working. Unfortunately, checking the logs won't do me any good because they aren't being written to.

Any ideas?

Edit: I'm being hasty today. I found some info on the Ubuntu forums and will be doing more testing. If I have further issues, after having exhausted my resources, I'll come back.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this