...

View Full Version : .htaccess file prob



sangeetakk
05-17-2010, 12:05 PM
jayson.barino@yahoo.com

Hello!!!

I have a problem with SEF url in PHP
I want url like
www.domain.com/index/user/username

actual url
www.domain.com/index.php?user=xyz

and my .htaccess file is

<files ~ "^\.ht">
Order allow,deny
Deny from all
</files>
<IfModule mod_rewrite.c>
RewriteBase /
<Files site>
ForceType application/x-httpd-php
</Files>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^localhost
RewriteCond $1 !^GUI/
RewriteRule ^(.*)$ /office/GUI/$1 [L]
RewriteRule index/(.*)/(.*)/$ /index.php?$1=$2 [P]
</IfModule>

but i am getting redirected by typing this url in

www.domain.com/index/user/username

Can you please let me know where i have done mistake.

Thanks in advance
Sang

Fou-Lu
05-17-2010, 04:12 PM
First, this isn't PHP code at all. Second, its definitely not a snippet. Moving from PHP Snippets to Apache configuration.
What you have and describe is correct (though you don't appear to need the files directive to control the htaccess file. That doesn't really make sense). You type in yoursite.com/index/user/Username, and you are redirected to index.php?user=Username correct? This is the normal behaviour of mod_rewrite. Sounds to me like you are also expecting it the other way around, but your links themselves will not rewrite in this way.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum