views:

52

answers:

2

I've got a rewriting scheme going on that was working fine. Basically, anything in the url is passed as a querystring to index.php, so /dave/bob is rewritten to /index.php?page=dave/bob. I deal with the parsing of this in index.php. Here's my .htaccess:

RewriteEngine on
RewriteRule ^([^\.]+)?$ index.php?page=$1 [L]

The problem I'm having is that sometimes the url is displaying incorrectly in the address bar. See these two examples: working and not working. The same problem occurs with the services page. For those of you who'd rather not visit external links, goldseal.skilldrick.co.uk/contact is displaying as goldseal.skilldrick.co.uk/contact/?page=contact in the address bar.

As you'll see, I'm currently working in a subdomain, which is being redirected to a directory under */public_html*, using cpanel. Might this be the cause?

A: 

Try putting a "/" in front of index.php.

malonso
Nope, no change :(
Skilldrick
malonso
Skilldrick
Skilldrick
malonso
I've tried that - for some reason when I deleted the slash I forgot to delete the question mark. Still doing the same thing though.
Skilldrick
Hmm, not sure. Well anyway, did you change something b/c the link you have above that says "not working", is working for my just fine.
malonso
A: 

Ok, I'm an idiot, but I've worked it out!

The reason services and contact were both causing problems was because I already had dirs under public_html/goldseal called /services and /contact (from a previous incarnation of the site), so the rewrite rule was getting confused when I told it to go to /contact.

Thanks for all your help, and sorry for wasting your time :P

Skilldrick