Forum Moderators: phranque

Message Too Old, No Replies

need help with RewriteRule

         

Krosik

12:13 am on Nov 12, 2006 (gmt 0)

10+ Year Member



hi

I'm not good in this matter, so I need help. I want to have this:

www.mydomain.com/en/xyz -> www.mydomain.com/en/index.php?page=xyz
www.mydomain.com/en/xyz/ -> www.mydomain.com/en/index.php?page=xyz
www.mydomain.com/en/xyz/abc -> www.mydomain.com/en/index.php?page=xyz

thanks in advance

jdMorgan

2:17 am on Nov 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, Krosik,

The process is outlined in the thread Changing Dynamic URLs to Static URLs [webmasterworld.com] -- A basic introduction to using mod_rewrite on Apache server to implement search-engine-friendly static URLs on dynamically-generated sites, in the Apache forum section of the WebmasterWorld library.

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials also in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim

Krosik

12:26 pm on Nov 12, 2006 (gmt 0)

10+ Year Member



hi

well I tried this

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^en/([^/]+)/?$ /index.php?page=$1 [L]

but when I go to

www.mypage.com/en/something

I see only error page

Not Found
The requested URL /en/something/ was not found on this server

.htaccess file is in folder "en"

[edited by: Krosik at 12:46 pm (utc) on Nov. 12, 2006]

jdMorgan

3:08 am on Nov 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your code looks correct.

Check your server error log file... It may tell you exactly what is wrong.

It may be that your server filepath has been aliased, and is not what you think it is. In this case, you may need to use mod_rewrite's RewriteBase directive to inject additional filepath information into the mod_rewrite process. If this is the case, you will see in your server error log that the filepath requested by your rewrite is not exactly what you expected it to be.

Jim