Forum Moderators: phranque
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.net
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^forum.html forum.php [L,NC]
RewriteRule ^index.html index.php [L,NC]
RewriteRule ^lyric.html lyric.php [L,NC]
RewriteRule ^vtopiclast([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?p=$1&highlight=$2 [L,NC]
RewriteRule ^vtopiclast([0-9]*).* viewtopic.php?p=$1 [L,NC]
RewriteRule ^viewpoll([0-9]*)-([0-9]*)-([a-zA-Z]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^vtopic([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?t=$1&highlight=$2 [L,NC]
RewriteRule ^vtopic([0-9]*).html&view=newest viewtopic.php?t=$1&view=newest [L,NC]
RewriteRule ^vtopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^vtopic([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2 [L,NC]
RewriteRule ^vtopic([0-9]*).* viewtopic.php?t=$1 [L,NC]
RewriteRule ^vtopic([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^404.html misc.php?xtra=404 [L,NC]
RewriteRule ^403.html misc.php?xtra=403 [L,NC]
RewriteRule ^400.html misc.php?xtra=400 [L,NC]
Options -Indexes
ErrorDocument 403 /403.html
ErrorDocument 401 /v-web/errdocs/401.html
ErrorDocument 500 /v-web/errdocs/500.html
ErrorDocument 400 /400.html
ErrorDocument 404 /404.html
I want to add a virtual directory so that when user goto
http://www.mysite.net/3it would be known as
http://www.mysite.net/profile.php?mode=viewprofile&u=3
I have tried
RewriteRule ^/([0-9]*) profile.php?mode=viewprofile&u=$1 [L]after the 400.html misc.php?xtra=400 but it doesn't work.
Also, tried add "RewriteBase /" that I found on some website but still doesn't work.
Anyone has any idea? Thank you.
I like to rewrite
http://www.mysite.net/3/p2to
http://www.mysite.net/profile.php?mode=viewprofile&u=3&page=2
RewriteRule ^([0-9]+)/p([0-9]+)/? profile.php?mode=viewprofile&u=$1&page=$2 [L]seem not to work :(
And also, rewrite
http://www.mysite.net/3/whatever here except p2 abovestill go to
http://www.mysite.net/profile.php?mode=viewprofile&u=3
because when i try to go to [mysite.net...] .. my image was broken because it looks into [mysite.net...]
Thanks.
Instead of using
<img src="blah.gif">
you'll need to use
<img src="/blah.gif">
This causes the browser to look for the image relative to the DocumentRoot, rather than relative to where it thinks the script is running.
Jim