dreamwest Posted November 14, 2008 Share Posted November 14, 2008 how can i rewrite the url seen in the adreess bar. Ive seen it done on youtube where www.youtube.com/inbox?message=1blablabla turns into : www.youtube.com/inbox I have a little bit of code using .htaccess file but im not having any luck with it: Options +FollowSymLinks RewriteEngine on RewriteRule ^channel/(.*)/(.*)/recent/(.*) video.php?category=recent&chid=$1&page=$3 Quote Link to comment https://forums.phpfreaks.com/topic/132685-how-can-i-rewrite-the-url/ Share on other sites More sharing options...
SuperBlue Posted November 14, 2008 Share Posted November 14, 2008 Saying "/?AID=$1" is the real url, and "/Articles/3/" is the url you wan't people to see, simply use the below. RewriteEngine on RewriteRule ^Articles/([0-9]+)/$ /?AID=$1 Quote Link to comment https://forums.phpfreaks.com/topic/132685-how-can-i-rewrite-the-url/#findComment-690399 Share on other sites More sharing options...
dreamwest Posted November 15, 2008 Author Share Posted November 15, 2008 thanks i suppose you cant tell me what this means (.*) im assuming it changes index.php/ into index/ Quote Link to comment https://forums.phpfreaks.com/topic/132685-how-can-i-rewrite-the-url/#findComment-690563 Share on other sites More sharing options...
Boo-urns Posted January 7, 2009 Share Posted January 7, 2009 From my understanding (.*) means the rewrite will accept any type of input (letters, numbers, anything) If you just want letters off the top of my head I think it is ([a-z][A-Z]) but I might be wrong. If you just want index.php to be rewritten to index/ it would be RewriteRule ^index$ /index.php If you want a trailing slash just change ^index$ to ^index/$ -Corey Quote Link to comment https://forums.phpfreaks.com/topic/132685-how-can-i-rewrite-the-url/#findComment-731666 Share on other sites More sharing options...
dreamwest Posted January 7, 2009 Author Share Posted January 7, 2009 From my understanding (.*) means the rewrite will accept any type of input (letters, numbers, anything) If you just want letters off the top of my head I think it is ([a-z][A-Z]) but I might be wrong. If you just want index.php to be rewritten to index/ it would be RewriteRule ^index$ /index.php If you want a trailing slash just change ^index$ to ^index/$ -Corey Thanks. A simple example is all i needed Quote Link to comment https://forums.phpfreaks.com/topic/132685-how-can-i-rewrite-the-url/#findComment-732003 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.