I'm guessing this should be moved to the newbies corner , as I'm guessing this may have quite a straight forward solution...
I am new to Mod rewrite and am really struggleing to get my head round it, despite all the help I have sourced on this site or the internet as a whole!
I am currently using the below code for a site I am developing:
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteRule \$ - [L]
RewriteRule ^([^/\.]+)/([^/\.]+)$ index.php?parent=$1&content=$2 [L]
RewriteRule ^([^/\.]+)$ index.php?content=$1 [L]
ErrorDocument 404 /404
However, I have stumbled accross two problems:
1)Accessing my site at domain.com is fine, however, accessing my site via ip.ad.dre.ss/~site causes problems. I am guessing this is something to do with my lack of a RewriteCond, using %{DOCUMENT_ROOT} ? I have played around with this but with no success.
2) The Error Document - not mod_rewrite I know, but because, for example, the page domain.com/a/b is showing domain.com/a/404, whereas I want it to show domain.com/404. Could I use a similar method as above (i.e %{DOCUMENT_ROOT}) to rectify this?
I hope I have made myself clear enough, and would really appreciate any help
Many thanks
Ian.[/code]