Results 1 to 7 of 7
Thread: mod rewrite
May 26, 2004, 07:20 #1
I'm trying to modify my url. Here's what i have in my .htaccess file.
RewriteEngine on RewriteRule ^/$ /index.php RewriteRule /([a-z]+) /index.php?pageName=$1
For an example if someone type in www.mywebsite.com/standard it should translate to: www.mywebsite.com/index.php?pageName=standard
<?php echo $_GET['pageName']; ?>
May 26, 2004, 07:39 #2
Are you trying to have it that anything that goes to rewrite.php is redirected to index.php?
May 26, 2004, 07:43 #3Originally Posted by sanka69
Sorry about the confusion, i fixed the question
May 26, 2004, 08:19 #4
Alright i figured out some stuff, first off my server didn't allow .htaccess so i had to go in httpd.conf and changed that. Now let my try to explain myself again.
I'm testing out mod_rewrite, i think it's somewhat working now.
ErrorDocument 404 /404.php RewriteEngine on RewriteRule /rewrite/([0-9]+) /rewrite.php?id=$1
<?php include ("header.php"); echo 'rewrite'; echo $_GET['id']; include ("footer.php"); ?>
I'm probably overlooking something.
May 26, 2004, 08:37 #5
May 26, 2004, 08:44 #6
Yea i looked at that. I think there's probably something wrong with my apache setting.
May 26, 2004, 21:45 #7
- Join Date
- Jul 2001
- 0 Post(s)
- 0 Thread(s)
Fire59 you cannot start with a slash a rewriterule within .htaccess.
So RewriteRule / won't have to be used within .htaccess.
RewriteRule ^rewrite/([0-9]+)/?$ /rewrite.php?id=$1
where ^ means start of string
$ means end of string
/? means trailing slash optional
Former Hosting Team Advisor
Former Advisor of '03