sauravrawal Posted April 4, 2010 Posted April 4, 2010 i want to rewrite the url as following ? http://hamroworld.com/mypage into http://hamroworld.com/profile.php?profile=mypage For example: if someone enters http://hamroworld.com/mypage he/she should get the content of hamroworld.com/profile.php?profile=mypage How to do this ?please help me here I have headache because of this !
Byron Posted April 4, 2010 Posted April 4, 2010 You can do that at your cpanel. Just look for the link that says Redirects. It should write something like this into your htaccess file: RewriteEngine on RewriteCond %{HTTP_HOST} ^hamroworld.com$ [OR] RewriteCond %{HTTP_HOST} ^www.hamroworld.com$ RewriteRule ^mypage$ "http\:\/\/profile\.php\?profile\=mypage" [R=301,L]
sauravrawal Posted April 5, 2010 Author Posted April 5, 2010 You can do that at your cpanel. Just look for the link that says Redirects. It should write something like this into your htaccess file: RewriteEngine on RewriteCond %{HTTP_HOST} ^hamroworld.com$ [OR] RewriteCond %{HTTP_HOST} ^www.hamroworld.com$ RewriteRule ^mypage$ "http\:\/\/profile\.php\?profile\=mypage" [R=301,L] Thanks but i want to rewrite hamroworld.com/anyvariable to hamroword.com/profile.php?profile=anyvariable It is not only 'mypage' I waiting for your help again
Byron Posted April 5, 2010 Posted April 5, 2010 I'm not to good with regex so if no one answers your question here you can make a post in this forum under "Apache configuration" http://www.codingforums.com/ I'm sure somebody there can help you.
DamegedSpy Posted April 6, 2010 Posted April 6, 2010 Had you done the PHP File? It should be simple: $_GET['page'] And querying the db for the contents. Just watch out for vulnerabilities. You can always learn PHP at http://w3schools.com After checking the website, do you mean more like restricting the pages to friends?
sauravrawal Posted April 7, 2010 Author Posted April 7, 2010 Had you done the PHP File? It should be simple: $_GET['page'] And querying the db for the contents. Just watch out for vulnerabilities. You can always learn PHP at http://w3schools.com After checking the website, do you mean more like restricting the pages to friends? Everything done only .htaccess remaining to work for me!
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