简体   繁体   中英

Apache proxypass or rewrite rules

I'm actually developping a small php website (only php, no java) and I would like to figure out something.

When I have this url called URL A: http://www.domain.com/?toto , everything's working I would like to rewrite it to http://www.domain.com/toto (called URL B) but when I tried, I have a 404 page not found.

What do I have to use to tell apache, when you have URL B it's an alias of URL A ??

It tried proxypass, Rewrite rules without reaching my aim. Can someone help me please?

Thx a lot !!!

You need to use Apache's mod_rewrite .

A simple rewrite rule can be placed in your .htaccess file (untested):

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) /index.php?$1 [L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM