htaccess rewrite code
Moderator: General Moderators
-
rajsekar2u
- Forum Commoner
- Posts: 71
- Joined: Thu Nov 20, 2008 4:23 am
htaccess rewrite code
hi,
Am creating a website. the url of the site looks like below
http://www.example.php
I want to convert it into http://www.example.htm using .htaccess rewite. How to do it.
And also i want to change the following url
http://www.example.php?cmd=201
to
http://www.example.php
how do this with .htaccess rewrite
Please help me
Am creating a website. the url of the site looks like below
http://www.example.php
I want to convert it into http://www.example.htm using .htaccess rewite. How to do it.
And also i want to change the following url
http://www.example.php?cmd=201
to
http://www.example.php
how do this with .htaccess rewrite
Please help me
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: htaccess rewrite code
Have you tried searching Google for "htaccess mod_rewrite"?
-
rajsekar2u
- Forum Commoner
- Posts: 71
- Joined: Thu Nov 20, 2008 4:23 am
Re: htaccess rewrite code
Ya i've found something. But dont know which one to use.
Please guide me in this. Caz i haven't used htaccess yet. this is the first time.
Thanks in advance.
Please guide me in this. Caz i haven't used htaccess yet. this is the first time.
Thanks in advance.
Re: htaccess rewrite code
http://www.example.htm and http://www.example.php aren't valid. Want to try saying it again?
-
rajsekar2u
- Forum Commoner
- Posts: 71
- Joined: Thu Nov 20, 2008 4:23 am
Re: htaccess rewrite code
http://example.php?cmd=somevalue
In the above url i want to hide ?cmd=somevalue
Is it possible in htaccess or any otherway
In the above url i want to hide ?cmd=somevalue
Is it possible in htaccess or any otherway
-
amargharat
- Forum Commoner
- Posts: 82
- Joined: Wed Sep 16, 2009 2:43 am
- Location: Mumbai, India
- Contact:
Re: htaccess rewrite code
your url is wrong, you are saying http://example.php?cmd=value
it should be http://www.domain.com/example.php?cmd=value
it should be http://www.domain.com/example.php?cmd=value
-
rajsekar2u
- Forum Commoner
- Posts: 71
- Joined: Thu Nov 20, 2008 4:23 am
Re: htaccess rewrite code
Sorry. I wrongly entered it.
The correct url is : http://www.domain.com/example.php?cmd=value
In this i want remove the value "cmd=value".
But i want the value of "cmd" in example.php page.
The correct url is : http://www.domain.com/example.php?cmd=value
In this i want remove the value "cmd=value".
But i want the value of "cmd" in example.php page.
-
amargharat
- Forum Commoner
- Posts: 82
- Joined: Wed Sep 16, 2009 2:43 am
- Location: Mumbai, India
- Contact:
Re: htaccess rewrite code
current url
http://www.domain.com/example.php?cmd=value
if you want to do rewrite in a following manner
http://www.domain.com/example/value
then in htaccess just write following line
http://www.domain.com/example.php?cmd=value
if you want to do rewrite in a following manner
http://www.domain.com/example/value
then in htaccess just write following line
Code: Select all
RewriteRule example/(.*)$ example.php?cmd=$1 // for numeric => ([0-9]+), for alphabets ([a-z]+)-
rajsekar2u
- Forum Commoner
- Posts: 71
- Joined: Thu Nov 20, 2008 4:23 am
Re: htaccess rewrite code
Thanks.
I've another doubt.
http://www.domain.com/folder/example.php?cmd=value
If the url is like below what to change on below
I've another doubt.
http://www.domain.com/folder/example.php?cmd=value
If the url is like below what to change on below
Code: Select all
RewriteRule example/(.*)$ example.php?cmd=$1 // for numeric => ([0-9]+), for alphabets ([a-z]+)-
amargharat
- Forum Commoner
- Posts: 82
- Joined: Wed Sep 16, 2009 2:43 am
- Location: Mumbai, India
- Contact:
Re: htaccess rewrite code
Code: Select all
RewriteRule folder/example/(.*)$ folder/example.php?cmd=$1 // for numeric => ([0-9]+), for alphabets ([a-z]+)-
amargharat
- Forum Commoner
- Posts: 82
- Joined: Wed Sep 16, 2009 2:43 am
- Location: Mumbai, India
- Contact:
Re: htaccess rewrite code
Code: Select all
RewriteRule folder/example/(.*)$ folder/example.php?cmd=$1 // for numeric => ([0-9]+), for alphabets ([a-z]+)-
rajsekar2u
- Forum Commoner
- Posts: 71
- Joined: Thu Nov 20, 2008 4:23 am
Re: htaccess rewrite code
Thanks