Page 1 of 1

HTACCESS - can you modify /hello ?

Posted: Mon Jan 27, 2014 5:29 am
by simonmlewis
[text]RewriteRule ^manufacturers/([^/]+) /index.php?page=manufacturers&menu=home&manufacturer=$1 [L]

RewriteRule ^([^/\.]+)/?$ index.php?page=$1&menu=home [L]
RewriteRule ^$ index.html [L][/text]

We have a site that uses HTACCESS, but we are building foreign versions. While I need the filenames to be in English, such as /products, we want the URLs to be in the foreign language.

Can you do a /page per file?

So www.thiswebsite.es/preguntas, takes you to www.thiswebsite.es/index.php?page=faq ??
We have about a dozen of these pages that need doing.

Thanks.

Re: HTACCESS - can you modify /hello ?

Posted: Mon Jan 27, 2014 6:33 am
by Celauran
You can do one entry per page if needed. Since you're already routing everything to a single page, you may want to look into adding a router to handle all these requests for you.

Re: HTACCESS - can you modify /hello ?

Posted: Mon Jan 27, 2014 6:37 am
by simonmlewis
How?

Re: HTACCESS - can you modify /hello ?

Posted: Mon Jan 27, 2014 6:42 am
by Celauran
Something like this maybe?

Code: Select all

RewriteRule ^(first-page|second-page|third-page)(/)?$ index.php?page=$1 [QSA, L]

Re: HTACCESS - can you modify /hello ?

Posted: Mon Jan 27, 2014 6:47 am
by simonmlewis
Thanks for that.
How does it know that "preguntas" is opening faq.inc ??

Re: HTACCESS - can you modify /hello ?

Posted: Mon Jan 27, 2014 6:52 am
by Celauran
Oh right, the translation. My bad. Forgot about that.

Code: Select all

RewriteRule ^preguntas/?$ index.php?page=faq [L]
RewriteRule ^otherpage$ index.php?page=tomatoes [L]
etc