views:

20

answers:

1

i have this file that is on the root folder called sumbit.php

and when i acesss a page like this for exmaple

 http://www.example.com/viewtopic.php?topic=14

the new url is

http://www.example.com/topic/14

on firebug its saying its accessing http://www.example.co.uk/topic/submit.php, when its meant to access http://www.example.co.uk/submit.php

my .htaccess code

RewriteEngine On

RewriteRule ^user/([^/]*)$ /viewprofile.php?user=$1 [L]
RewriteRule ^topic/([^/]*)$ /viewtopic.php?topic=$1 [L]

i dont seem to see what the problem is, p.s. the sumibit.php is from a form submit action

+1  A: 

That's happening because the link to submit.php in your HTML is using relative paths. Relative paths depend on which directory you're currently in. So when you add slashes to your URL, it gets all messed up.

You should fix your HTML to use absolute paths (/submit.php). If this is not possible, write a new rewrite rule that will map ^.*/submit.php$ to the correct path.

kijin
so i need to do that rewrite rule for all the files
getaway
@getaway Just add `RewriteRule ^.*/submit.php$ /submit.php [L]` to your .htaccess file. Or you can hunt down all relative paths and fix each of them.
kijin