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
url restructure
Moderator: General Moderators
Re: url restructure
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
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
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
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.
#LoadModule rewrite_module modules/mod_rewrite.so
Remove the # save it and restart your server, you should be good to go.
- Kaleb Klein
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156
------------------------------------
Web Developer | Software Developer
https://kalebklein.com
PGP Key: https://keybase.io/pazuzu156