logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: mod_rewrite not work
Author
aksan



Joined: 29 Jul 2006
Posts: 2

PostPosted: Sat 29 Jul '06 16:45    Post subject: mod_rewrite not work Reply with quote

All, need your advice, I'm using WAMP, after installing WAMP i'm trying a simple code in htaccess:
Code:

Options +FollowSymLinks
RewriteEngine On
RewriteRule google http://www.google.com/? [R,L]

but its not wotking?

i make it more simple, i create file named alice.html and bob.html that show alice and bob words, thus i create .htaccess file like this Code:
Code:
RewriteEngine on
RewriteRule ^alice.html$ bob.html


when i see write in broser mysite.com/alice.html page and content still alice.html, it should be content with bob.html, what wrong???

Actually my phpinfo() have Loaded Modules:
core mod_win32 mpm_winnt http_core mod_so mod_access mod_actions mod_alias mod_asis mod_auth mod_autoindex mod_cgi mod_dir mod_env mod_imap mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_rewrite mod_setenvif mod_userdir mod_php5

i has mod_rewrite loaded! but still not work?
any solution?

another questions:
1. should i put my .htaccess in parent folder eg: www??
2. if i indexing the folder, htaccess ahow like this "htaccess.htaccess ", its correct? not .htaccess?
3. there is another thing that i should configure in my conf, because WAMP already AllowOverride all, load mod_rewrite.

sorry if make you all more confuse, need advice
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Sat 29 Jul '06 17:18    Post subject: Reply with quote

What do you want to achive ?

If you want to learn mod_rewrite, see:

http://rewrite.drbacchus.com/
http://www.apachelounge.com/viewtopic.php?t=54
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
http://www.fluidthoughts.com/howto/mod_rewrite/



Steffen
Back to top
aksan



Joined: 29 Jul 2006
Posts: 2

PostPosted: Sat 29 Jul '06 19:00    Post subject: Reply with quote

I have links:
Mysite.com/index.php?page=detail&id=1
Mysite.com/index.php?page=detail&id=20
Mysite.com/index.php?page=galery&jump=thumb&kat=14&id=17
Mysite.com/index.php?page=galery&jump=thumb&kat=13&id=40

I want change to:
Mysite.com/index/detail/1.html
Mysite.com/index/detail/20.html
Mysite.com/index/galery/thumb/14/17.html
Mysite.com/index/galery/thumb/13/40.html

So I write down .htaccess like this:

RewriteEngine On
#show like index/detail/id_artikel.html
RewriteRule ^index/(.*)/(.*).html index.php?page=$1&id=$2
#show like index/galery/thumb/kat/id_gambar.html
RewriteRule ^index/(.*)/(.*)/ (.*).html index.php?page=$1&kat=$2&id=$3

all of URl friendly not working, so i test it with simple code, its still not working. as i wrote before.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Mon 31 Jul '06 2:53    Post subject: Reply with quote

Does the following work ?

RewriteRule /google http://www.google.com [R,L]
Back to top


Reply to topic   Topic: mod_rewrite not work View previous topic :: View next topic
Post new topic   Forum Index -> Apache