Few days back I had posted a question related to this and I got some great push. Also I did some experimenting and research and achieved some good result. here is what exactly I have achieved. I put this in my .htaccess in my folder -'folder':
RewriteEngine On
#Look for the word "post" and take everything after "post" and store it in $1
RewriteRule post(.+)$ something.php?file=$1 [L]
# allow public pages
RewriteRule ^index.php$ - [L]
RewriteRule ^style.css$ - [L]
RewriteRule ^bg.png$ - [L]
RewriteRule ^cat_bgg.gif$ - [L]
RewriteRule ^cat_bgr.png$ - [L]
RewriteRule ^h1_bg.gif$ - [L]
RewriteRule ^hd_bg.png$ - [L]
RewriteRule ^menu_bg.png$ - [L]
# serve everyone from specific-domain or specific-user-agent
RewriteCond %{HTTP_REFERER} ^http?://www.abc.com [OR]
RewriteCond %{HTTP_USER_AGENT} ^specific-user-agent$
RewriteRule ^ - [L]
# everybody else receives a forbidden
RewriteRule ^ - [F]
ErrorDocument 403 /index.php
So this is how it is working now: I put a link on:
www.abc.com
as
www.xyz.com/folder/post(somecode)
When someone clicks this link, as per .htaccess 'somecode' is taken and stored in $1 and processes:
www.xyz.com/folder/something.php?file=$1
and displays this content. But the url shown in browser is:
www.xyz.com/folder/post(somecode).
Now this is what I want to do. Instead of displaying:
www.xyz.com/folder/post(somecode)
can i show something nice like
www.xyz.com/somethingnice
or
www.xyz.com/folder/someword
How do I do this? Should I add something after the line RewriteRule post(.+)$ something.php?file=$1 [L]
Or is there some other method?