473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

.htaccess redirect url

17
Hi All I am posting this message again I could not get too much help from my previous post. This time I want to make things simple.
www.example.com/index/command/message/1
www.example.com/index/command/message/2
how can I convert above urls to the following one(same for all)
www.example.com/command
Whever text after (index/command/message/1), I want it to convert
www.example.com/command
Please help. Thanks in advance.
Jun 19 '07 #1
5 5524
Motoma
3,237 Expert 2GB
Hi All I am posting this message again I could not get too much help from my previous post. This time I want to make things simple.
www.example.com/index/command/message/1
www.example.com/index/command/message/2
how can I convert above urls to the following one(same for all)
www.example.com/command
Whever text after (index/command/message/1), I want it to convert
www.example.com/command
Please help. Thanks in advance.
You could use mod_rewrite or mod_proxy or mod_alias to do this. But the more favorable way would be to use the language which you programmed the rest of your site in to provide a HTTP Redirect so that search engines appropriately handle this as well.
Jun 20 '07 #2
xiaawan
17
Dear thank you very much for your reply. Although my requirement is changed by the client but I try it for my future knowledge. Again thank you very much. :)
Jun 22 '07 #3
Motoma
3,237 Expert 2GB
Dear thank you very much for your reply. Although my requirement is changed by the client but I try it for my future knowledge. Again thank you very much. :)
You are quite welcome. Come back any time you have a question.
Jun 22 '07 #4
xiaawan
17
Dear few days back I asked a question about .htaccess. Now I have anohter question. How can I use .htaccess at localhost. I have searched on the net but did not get any useful help. My system is having windows and I am using Apache. How can I use .htaccess to redirect urls on localhost.
for example:
my actual url is as follows:
http://localhost/site/index/contact/message/1 and I want it to convert as follows
http://localhost/site/contact/1
Thanks in Advance.
Jun 25 '07 #5
Motoma
3,237 Expert 2GB
Dear few days back I asked a question about .htaccess. Now I have anohter question. How can I use .htaccess at localhost. I have searched on the net but did not get any useful help. My system is having windows and I am using Apache. How can I use .htaccess to redirect urls on localhost.
for example:
my actual url is as follows:
http://localhost/site/index/contact/message/1 and I want it to convert as follows
http://localhost/site/contact/1
Thanks in Advance.
You would do this the same way you would do it for the outside, through use of mod_rewrite.
Jun 25 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Nel | last post by:
Just looking for some general advice on modifying the URL for php. I am using .htaccess to allow a web site to translate example.html to index.php?content=example (below) ErrorDocument 404...
1
by: deko | last post by:
Can I use PHP and htaccess to authenticate users? My service provider lets me password protect directories on my web site - using htaccess. If a user tries to access a page within a password...
9
by: deko | last post by:
I want to use htaccess for authentication on my php site since I only have a few users who need access to secure areas. So, I created a new directory off public_html (secretDocs) and in that...
15
by: Taki Jeden | last post by:
Hello everybody Does anybody know why w3c validator can not get pages that use 404 htaccess redirection? I set up two web sites so that clients request non-existent urls, but htaccess redirects...
3
by: Vardan Kushnir | last post by:
Please forgive me if my English is poor. Also please tell me if this is wrong place to ask this question and tell me better place. When searching web for information Re: .htaccess and...
5
by: tommytx | last post by:
Is there any capability of decisions in htaccess. I know you can use in special situations, but I need something like: If a then b etc like in php. In other words I want to redirect the...
5
by: deko | last post by:
I'm trying to redirect requests for /index.php to /mydirectory/index.php If I use an index file in / with only this line: <?php header("Location:http://www.mysite.com/mydirectory/"); ?> that...
0
by: Stuart Palmer | last post by:
Hi everyone, I'm trying to look for an asp equivilent of .htaccess that is used on apache servers but for use with asp. I am doing a website and moving lots of files into a single directory to...
2
by: RuthC | last post by:
Hi. I am using .htaccess to redirect in my website Now I want to redirect a url, which Contain '-' to another url. ex: RewriteRule ^book-and-magazine-discount/ query.php?q=$1.
1
by: Lagon666 | last post by:
Hi I wanna have a htaccess file that when i go to "www.domain.com/sometext" the page redirect to "www.domain.com/user.php?user=sometext". It's important that is better that URL not end with slash....
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.