Gregor386 Posted March 17, 2010 Share Posted March 17, 2010 I've been trying to get this working for a while now, but cant:Sdomain.com/ = test.phpdomain.com/name = test.php?p=namedomain.com/othername = test.php?p=othernamedomain.com/directory/ = domain.com/directorydomain.com/img/myres.png = domain.com/img/myres.pngdomain.com/css/myres.css = domain.com/css/myres.cssEverything I try gives me a server error (RewriteRule (.*)$ test.php?p=$1), but if I use something like (RewriteRule ^p=(.*)$ test.php?p=$1) it works.I also tried variations of RewriteCond, but /sth is not threated nor as a directory (-d) nor as a file (-f) it just tries to acces /sth on my serverI'm really loosing it here, any tip would be apprechiated!Gregor Link to comment Share on other sites More sharing options...
Gregor386 Posted March 17, 2010 Author Share Posted March 17, 2010 in case mod_rewrite threats /sth and /sth/ the same, than I can just hardcode the directories I wouldnt like beeing passed (/img/ /css/ ...) or check if they exist, I belive that is possible. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 17, 2010 Share Posted March 17, 2010 What rules are you using now? Link to comment Share on other sites More sharing options...
Gregor386 Posted March 17, 2010 Author Share Posted March 17, 2010 What rules are you using now?RewriteRule ^page/(.*)$ /test.php?p=$1RewriteCond %{REQUEST_FILENAME} -dRewriteRule (.*)$ /test.phpI tried many variations ofRewriteRule ^(.*)$ /test.php?p=$1alsoRewriteRule (.*)$ /test.php?p=%{REQUEST_URI}I am trully lost and cant wrap my head around how mod_rewrite does this:S Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.