Forum Moderators: phranque
I'm a newbie for working with apache and .htaccess file. I've seen the tutorial on this thread [webmasterworld.com]. My code now is:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
#
RewriteRule ^category/product/([0-9]+)/?$ catprod.php?cat=$1[L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /catprod\.php\?cat=([^&]+)\ HTTP/
RewriteRule ^catprod\.php$ http://www.example.com/store/category/product/%1? [R=301,L] However, i don't see any change on my url bar on the browser.
Could someone point me where i do wrong?
Thank you,
ayok
[edited by: jdMorgan at 7:35 pm (utc) on Sep. 13, 2008]
[edit reason] changed to example.com and fixed [ code ] tags [/edit]
A rewrite connects that URL to the internal filepath on the server.
.
What do you want people to see as the URL?
What is the location on the server (the filepath) where the content really is?
.
You have a redirect there and a rewrite.
The redirect (the stuff with [R=301,L] on) needs to be first.
The rewrite (the stuff with [L] on) needs to be last.
As you have it now, you could expose internal paths out into the URL by redirecting after the rewrite has occurred.
.
RewriteBase / - is the default. You likely can omit that line.
I guess in I don't need redirect on this case. Should I delete the [R]? However, I still got no result with or without it.
FYI, I have no authorization to change anything on php.ini. Do I need to do something there? Once again, I am new for this stuff.
Thanks,
ayok
Thank you,
ayok
[edited by: jdMorgan at 7:36 pm (utc) on Sep. 13, 2008]
[edit reason] Please use example.com only [/edit]