开发者

why is mod_rewrite facility working?

开发者 https://www.devze.com 2023-01-22 10:48 出处:网络
I am开发者_运维百科 trying to do simple rewriting url with using mod_rewrite facility of Apache.

I am开发者_运维百科 trying to do simple rewriting url with using mod_rewrite facility of Apache.
As they said i firstly remove the # from the

LoadModule rewrite_module modules/mod_rewrite.so

from conf. file. then i restart my apache.

now what i want is something like this...

on my index page there is one menu in which their is one link of "aboutus" like this..

<a href="aboutus"><strong>about</strong></a>

now in my htaccessfile, i had written something like this...

Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^aboutus$ tempindex.php?id=3
</IfModule>

and if i tried to click on the aboutus then its shows error HTTP 404 - Not Found.

EDIT: I am trying to make my url as

www.example.com/aboutus

but actual the url will be

www.example.com/tempindex.php?id=3


You can use the rewrite log and rewrite log level directives in your httpd.conf to get Apache to tell you all about the matches it makes (or doesn't).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号