coolshrimp Posted January 12, 2015 Share Posted January 12, 2015 Hey guys im looking for a simple way to simplify a URLi want to have a .php page load by grabing usename with $_Getbut i want the URL to look simpleSo right now the users have to type this to load there profile page: http://www.mypostedresume.com/view.php?Username=coolshrimp id like to make it simpler: http://view.mypostedresume.com/coolshrimp So I want them to be able to use subdomain "View" and then tailing tag be the username that .php grabs to load data. how can i do this? Link to comment Share on other sites More sharing options...
Ingolme Posted January 12, 2015 Share Posted January 12, 2015 You can search for URL rewriting. How it's done depends on what software is running on your server and how it's configured. Many servers use Apache in which you can use mod_rewrite directives in a .htaccess file in order to change the URL. It's not easy, you have to be willing to learn something new. Link to comment Share on other sites More sharing options...
coolshrimp Posted January 12, 2015 Author Share Posted January 12, 2015 ok thanks ill look into it. Link to comment Share on other sites More sharing options...
coolshrimp Posted January 14, 2015 Author Share Posted January 14, 2015 (edited) Having issues getting this to work iv setup subdomain "view" to point to the folder:view.mypostedresume.com/ points to same place as mypostedresume.comim using following in the .htaccess file: RewriteEngine onRewriteRule ^view.mypostedresume.com/(.+)$ view.mypostedresume.com/view.php?Username=$1 [L] so if they visit: http://view.mypostedresume.com/coolshrimp they should see content from: http://www.mypostedresume.com/view.php?Username=coolshrimp Edited January 14, 2015 by coolshrimp Link to comment Share on other sites More sharing options...
coolshrimp Posted January 14, 2015 Author Share Posted January 14, 2015 Any one able to tell me what code will work for me? I need 2 things: Make Nice Easy URL to view userpages: User Types in:view.mypostedresume.com/coolshrimpurl rewrite to:mypostedresume.com/view.php?Username=coolshrimp If they try to visit: view.mypostedresume.com/index.phpview.mypostedresume.com/contact.phpRedirect them back to non subdomain link:mypostedresume.com/contact.phpmypostedresume.com/index.php Link to comment Share on other sites More sharing options...
dsonesuk Posted January 14, 2015 Share Posted January 14, 2015 you are telling to go to sub-domain again remove 'view.' from required rewritten url RewriteEngine onRewriteRule ^view.mypostedresume.com/(.+)$ mypostedresume.com/view.php?Username=$1 [L] tested here and seems to work http://martinmelin.se/rewrite-rule-tester/ Link to comment Share on other sites More sharing options...
coolshrimp Posted January 15, 2015 Author Share Posted January 15, 2015 (edited) you are telling to go to sub-domain again remove 'view.' from required rewritten url RewriteEngine onRewriteRule ^view.mypostedresume.com/(.+)$ mypostedresume.com/view.php?Username=$1 [L] tested here and seems to work http://martinmelin.se/rewrite-rule-tester/ thanks but does not seem to work for now im using. RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^([^/.]+)/?$ /view.php?Username=$1 [L,QSA] so i can simply visit: http://mypostedresume.com/coolshrimpill worry about the "view" subdomain later. Edited January 15, 2015 by coolshrimp Link to comment Share on other sites More sharing options...
bonvisao Posted January 26, 2015 Share Posted January 26, 2015 You can search for URL rewriting. How it's done depends on what software is running on your server and how it's configured. Many servers use Apache in which you can use mod_rewrite directives in a .htaccess file in order to change the URL. It's not easy, you have to be willing to learn something new. Yes ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now