Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #17096 > unrolled thread
| Started by | "dentysta" <witekr@interia.pl> |
|---|---|
| First post | 2016-09-24 16:22 +0200 |
| Last post | 2016-09-25 09:40 +0200 |
| Articles | 5 — 5 participants |
Back to article view | Back to comp.lang.php
Set web page lang via .htaccess "dentysta" <witekr@interia.pl> - 2016-09-24 16:22 +0200
Re: Set web page lang via .htaccess Jerry Stuckle <jstucklex@attglobal.net> - 2016-09-24 10:55 -0400
Re: Set web page lang via .htaccess Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-24 21:44 +0200
Re: Set web page lang via .htaccess Luuk <luuk@invalid.lan> - 2016-09-24 22:47 +0200
Re: Set web page lang via .htaccess "R.Wieser" <address@not.available> - 2016-09-25 09:40 +0200
| From | "dentysta" <witekr@interia.pl> |
|---|---|
| Date | 2016-09-24 16:22 +0200 |
| Subject | Set web page lang via .htaccess |
| Message-ID | <ns626m$bb$1@opal.futuro.pl> |
Hi all, I'm trying to prepare right .htaccee mod rewrite rules for my online shop. On my store, lang is set by lang_id variable on the url: http://mystore.com/index.php?lang_id=[pl, en, de] I need to rewrite this url to http://mystore.com/en/index.php My .htaccess file alredy have following rule: RewriteEngine On RewriteBase / RewriteRule ^(pl|en)/(.*)$ $2?lang_id=$1 [L,QSA] How to redirect to (sufix with default lang_id): http://mystore.com/en/index.php after writing simple mystore.com ? The following rule, added to .htassess doesn't work properly :Location / Redirect 301 /pl/index.php pozdrawiam / best regards Edentarius
[toc] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2016-09-24 10:55 -0400 |
| Message-ID | <ns643r$mnt$1@jstuckle.eternal-september.org> |
| In reply to | #17096 |
On 9/24/2016 10:22 AM, dentysta wrote: > Hi all, > > I'm trying to prepare right .htaccee mod rewrite rules for my online shop. > > On my store, lang is set by lang_id variable on the url: > http://mystore.com/index.php?lang_id=[pl, en, de] > I need to rewrite this url to http://mystore.com/en/index.php > > My .htaccess file alredy have following rule: > > RewriteEngine On > RewriteBase / > RewriteRule ^(pl|en)/(.*)$ $2?lang_id=$1 [L,QSA] > > How to redirect to (sufix with default lang_id): > http://mystore.com/en/index.php > after writing simple > mystore.com ? > > The following rule, added to .htassess doesn't work properly :Location / > Redirect 301 /pl/index.php > > pozdrawiam / best regards > Edentarius > > Nothing to do with PHP. Try an Apache newsgroup. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2016-09-24 21:44 +0200 |
| Message-ID | <5198799.lOV4Wx5bFT@PointedEars.de> |
| In reply to | #17096 |
dentysta wrote: > I'm trying to prepare right .htaccee mod rewrite rules for my online shop. .htaccess, mod_rewrite > […] > How to redirect to (sufix with default lang_id) […] ? _suffix_ > The following rule, added to .htassess doesn't work properly .htaccess > :Location / > Redirect 301 /pl/index.php That your application is a PHP-based application that requires redirection and/or URL rewriting does not make server-side redirection or URL rewriting *without PHP* on-topic here. It is a Web server (here: Apache/httpd) feature, to be discussed in comp.infosystems.www.servers.ALL (here: probably ciws.unix). Your "rule" (better: directive) does not work properly (that is _not_ a problem *description*) because it uses invented syntax. Also, combining *simple* redirection with URL rewriting is not a good idea, unless you really know what you are doing. You should then do redirection with URL rewriting instead, if necessary. IOW: RTFM → <http://httpd.apache.org/docs/> Finally, you should post to Usenet with your real name in the “From” header field value, and proofread your postings. We have learned from experience that pseudonymouses are likely to be lusers (including trolls), and sloppy coders are likely to be sloppy thinkers, probably wasting our precious free time. <http://catb.org/esr/faqs/smart-questions.html> -- PointedEars Zend Certified PHP Engineer <http://www.zend.com/en/yellow-pages/ZEND024953> | Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail.
[toc] | [prev] | [next] | [standalone]
| From | Luuk <luuk@invalid.lan> |
|---|---|
| Date | 2016-09-24 22:47 +0200 |
| Message-ID | <974d33f7-87b9-8255-916e-a6f8e84f7b31@invalid.lan> |
| In reply to | #17098 |
On 24-09-16 21:44, Thomas 'PointedEars' Lahn wrote: > dentysta wrote: > >> I'm trying to prepare right .htaccee mod rewrite rules for my online shop. > > .htaccess, mod_rewrite > >> […] >> How to redirect to (sufix with default lang_id) […] ? > > _suffix_ > >> The following rule, added to .htassess doesn't work properly > > .htaccess > >> :Location / >> Redirect 301 /pl/index.php > Thank you for giving us typing lessons! > > Finally, you should post to Usenet with your real name in the “From” header > field value, and proofread your postings. We have learned from experience > that pseudonymouses are likely to be lusers (including trolls), and sloppy > coders are likely to be sloppy thinkers, probably wasting our precious free > time. > really? > <http://catb.org/esr/faqs/smart-questions.html> > <http://catb.org/esr/faqs/smart-answers.html>
[toc] | [prev] | [next] | [standalone]
| From | "R.Wieser" <address@not.available> |
|---|---|
| Date | 2016-09-25 09:40 +0200 |
| Message-ID | <57e77f6f$0$941$e4fe514c@news.xs4all.nl> |
| In reply to | #17103 |
Luuk, > <http://catb.org/esr/faqs/smart-answers.html> Although I would have loved to have seen that page, it does not seem to exist (anymore). :-( Though the "smart questions" page our lovable "pointed ears" fellow referred to does have a "How To Answer Questions in a Helpful Way" chapter at the bottom. Fun thing though: the creator of that page has got a *lot* to say about how questions should be asked, he has got remarkable little about how they should be answered ... Fun thing #2: Even though the above chapter consists of just a few suggestions, "pointed ears" here seems to enjoy to break all of them at once, and that most every time. Advice: Ignore him. His "help" most often consists about complaint or ridicule. Regards, Rudy Wieser -- Origional message: Luuk <luuk@invalid.lan> schreef in berichtnieuws 974d33f7-87b9-8255-916e-a6f8e84f7b31@invalid.lan... > On 24-09-16 21:44, Thomas 'PointedEars' Lahn wrote: > > dentysta wrote: > > > >> I'm trying to prepare right .htaccee mod rewrite rules for my online shop. > > > > .htaccess, mod_rewrite > > > >> [.] > >> How to redirect to (sufix with default lang_id) [.] ? > > > > _suffix_ > > > >> The following rule, added to .htassess doesn't work properly > > > > .htaccess > > > >> :Location / > >> Redirect 301 /pl/index.php > > > > Thank you for giving us typing lessons! > > > > > > Finally, you should post to Usenet with your real name in the "From" header > > field value, and proofread your postings. We have learned from experience > > that pseudonymouses are likely to be lusers (including trolls), and sloppy > > coders are likely to be sloppy thinkers, probably wasting our precious free > > time. > > > > really? > > > <http://catb.org/esr/faqs/smart-questions.html> > > > > <http://catb.org/esr/faqs/smart-answers.html> > >
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web