Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
by bitsys » Sat Oct 20, 2012 4:54 am
hello members
I have created a php website and its almost complete but the only thing that keeps bugging me is the way url is being displayed. To be more specific i have the link showing up in the address bar in eg
www.mywebsite.com/index.php?page=contact fashion whereas i want it to be displayed as
www.mywebsite.com/contact.
kindly help me with this issue..
thanks in advance
-
bitsys
- New php-forum User

-
- Posts: 3
- Joined: Sat Oct 20, 2012 4:41 am
by simplypixie » Mon Oct 22, 2012 2:55 am
You need to use .htaccess file to make 'friendly' urls, so create a file called .htaccess (if not already there) in your site root and add something like this (not tested):
- Code: Select all
RewriteEngine on
RewriteRule ^/([a-zA-Z0-9]+)\$ index.php?page=$1
-

simplypixie
- php-forum Active User

-
- Posts: 289
- Joined: Sun Dec 11, 2011 12:51 am
- Location: Shrewsbury, Shropshire
-
by bitsys » Mon Oct 22, 2012 6:53 am
thanx for the kind reply simplypixie

finally figured out how it is to be resolved...
cheers
-
bitsys
- New php-forum User

-
- Posts: 3
- Joined: Sat Oct 20, 2012 4:41 am
Return to PHP coding => General
Who is online
Users browsing this forum: Google [Bot] and 1 guest