|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
.htaccess for a multi-language site
I'm an Apache newbie.
I have Apache+php+mysql. I have access to the .htaccess file. I would like to have this virtual directory: mysite.com/en/articles/1/ (english language, article 1) point to this: articles?lang=en&id=1. Inside my .htaccess I can use the RewriteRule to do so. It works fine but... My problem is that I do not want to change the url! Want to have in the url bar mysite.com/en/articles/1/ but call articles?lang=en&id=1. Do you think that the only way to do so is to use a script? such as: <Files en> ForceType application/x-httpd-php </Files> and inside it call different pages? <Thanks for advice> Andrea </Thanks> |
|
#2
|
|||
|
|||
|
>> My problem is that I do not want to change the url!
Then you'd be looking at internal redirection. >> Do you think that the only way to do so is to use a script? No. Just do a search in this forum. I have replied to this stuff dozen times. |
|
#3
|
||||
|
||||
|
Thank you for your answer.
As you said doing a search in the forum I found my answers. I use as you said an internal redirection and it worked fine for my needs. This on my Pc. Last night I discovered that my web hosting apache configuration do not have the mod_rewrite installed. They will evaluate to install it, but I have no time to wait them for. I'm in a hurry with my web site project, so I think that I will use the script solution. Thanks again, ciao Andrea. |
|
#4
|
|||
|
|||
|
mod_rewrite is the only scripting language-like modules embedded to Apache. Yes, it's not a default module but it's highly recommended to add it to take advantage of its flexibility and functionality.
If your host refuse to add it, just switch host, not because they don't listen to customers, but they are not aware of how powerful mod_rewrite can be due to their limited technical experience. |
|
#5
|
||||
|
||||
|
An opinion
Sorry for taking your time,
but need some advices. I'm looking for a new web hosting service. I found one that could give me what I need, an access to httpd.conf file and more. I could choose a root access but this plan cost too much for me (150$) instead of (60$). More technically: Their machine is base on freeBSD 4.1, I see the last stable is 4.3. You write in other posts that Apache+freeBSD it's good union. Their machine has Apache(1.3.12) + freeBSD4.1, are this releases a good choice? This is a more specific apache question. The modules compiled with their apache are: mod_so.c mod_auth_mysql.c mod_frontpage.c Are this a good setup or a basic important module is missing? I use Php+Apache+MySQL. At this time I use htppd.conf and .htaccess to do some "internal redirection", or disallow some access to certain directory. Maybe one day I'll need some virtual hosting. Hope not asking something repetitive. Thanks you Andrea. |
|
#6
|
|||
|
|||
|
>> I could choose a root access
What do you mean by root access? You have unrestricted full control of their server? Have you ever thought of running Apache off your own box? >> heir machine has Apache(1.3.12) + freeBSD4.1, >> are this releases a good choice? FreeBSD alone is a much better choice than Linux and any others. Apache 1.3.12 is a bit out of date, consider the latest 1.3.20 if at all possible. >> The modules compiled with their apache are:..... Those are just the modules compiled in statically. As you can see from mod_so, there should be alot more shared modules not being listed. mod_frontpage is not a good module to have it compiled in any case (even in a hosting environment). It potentially adds more vulnerabilities to the server. Not only that, it also requires a large value for RLimitCPU and RLimitMEM then your system defaults. That said, mod_frontpage alone simply takes up too many system resources. In other words, don't use MS server products if possible. Linux is also out of my consideration just because of the existence of BSDs. >> At this time I use htppd.conf and .htaccess to do some "internal redirection" You don't really need to have write access to httpd.conf to do internal redirection, .htaccess is just fine (except RewriteMap). For performance and reliability wise, it's better to do it in httpd.conf. Anyhow, try to figure out the opportuntity cost for running your own server rather than hosting with others. At the very least, hardware cost is no longer a concern these days. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > .htaccess for a multi-language site |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|