Page 1 of 1

url restructure

Posted: Fri Jul 01, 2011 3:04 pm
by nite4000
I need some help here guys i am doing some work for a friend and he wants me to restructure his url and what i mean is there is a link that go to this

http://www.domain.com/?a=details&lid=5
details being the page and lid being the id from the table

but he wants me to make it go to this
http://www.domain.com/sitetitle

title being from the table where the id is. but i cant figure how to remove the details part.

I can make it go to http://www.domain.com/?a=details&title=sitetitle but i would still have the ?a=details part.

anyone that can give me a shout let me know

Thanks

Re: url restructure

Posted: Fri Jul 01, 2011 8:14 pm
by twinedev
Try adding the following to (or create it) the .htaccess file in the root of your web directory:[text]RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) /index.php?a=details&title=$1 [L][/text]
What it is doing: Any request made to the server, that is NOT a file that exists and is NOT a directory that exists, it will take you to index.php with the parameters you were able to work with.

-Greg

Re: url restructure

Posted: Sat Jul 02, 2011 5:25 am
by nite4000
that didnt work i got a internal error. I have never done this before. i have rea don it but still dont understand it

Re: url restructure

Posted: Thu Jul 07, 2011 3:33 pm
by Pazuzu156
One thing is you need to edit the httpd.conf file for Apache if that is the server you are using. Look for:

#LoadModule rewrite_module modules/mod_rewrite.so

Remove the # save it and restart your server, you should be good to go.