Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 11-07-2008, 11:40 AM   #1
roycecheng.com
 
Join Date: Nov 2008
Location: Singapore
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Social Networking View Member's FaceBook Profile  View Member's YouTube Profile
Default how to remove index.php on the URL?

hi everyone!

I got a query.. How do I remove the index.php from my URL? I heard I have to edit .htaccess, but I totally have no idea how to go about doing it and is afraid of removing any important stuffs.

example: example.com/index.php/blog-title

Experts, please help!

[Case closed]

killua is offline   Reply With Quote
Old 11-07-2008, 12:46 PM   #2
Web Developer
 
wayfarer's Avatar
 
Join Date: Nov 2008
Location: Asheville, NC USA
Posts: 420
Thanks: 18
Thanked 57 Times in 51 Posts
Social Networking View Member's Twitter Profile 
Default Re: how to remove index.php on the URL?

The example you gave is nonsensical, as there is no way to create a directory within a page.

You can link to the root without linking to index.php, just by linking to a forward slash:
HTML Code:
<a href="/">Home</a>

Wayfarer | join me on StoryBlorg
wayfarer is offline   Reply With Quote
Old 11-07-2008, 09:12 PM   #3
Advanced Warrior
War Room Member
 
zoobie's Avatar
 
Join Date: Sep 2007
Location: hong kong
Posts: 933
Blog Entries: 2
Thanks: 3
Thanked 39 Times in 34 Posts
Default Re: how to remove index.php on the URL?

killua, not quite understand of what you are asking..
the index.php (or index.html) are the default web pages that most web server to configure showing up if someone type for example http://www.xyz.com/
on the users browsers. and
are you asking how default goes to http://www.example.com/blog-title/ when some one types in your domain?

well then you can add a php redirect to the directory /blog-title/
or you can do htaccess to create a permanent 301 redirect (which also tells the search engine to skip your default home page and index the new directory)

I personally prefer to use php redirect because it is much easier: (just one line code in your index page and that's it.
the code:
Quote:
<?php
Header( "HTTP/1.1 301 Moved Permanently" );
header( 'Location: http://www.yoursite.com/new_page.html' ) ;
?>
and add this to a file name index.php and that's it. That means rename your old index.php to something else if you want to keep that...

hopes that help

zoobie is offline   Reply With Quote
Old 11-07-2008, 09:16 PM   #4
Advanced Warrior
War Room Member
 
zoobie's Avatar
 
Join Date: Sep 2007
Location: hong kong
Posts: 933
Blog Entries: 2
Thanks: 3
Thanked 39 Times in 34 Posts
Default Re: how to remove index.php on the URL?

killua, not quite understand of what you are asking..
the index.php (or index.html) are the default web pages that most web server to configure showing up if someone type for example http://www.xyz.com/
on the users browsers. and
are you asking how default goes to http://www.example.com/blog-title/ when some one types in your domain?

well then you can add a php redirect to the directory /blog-title/
or you can do htaccess to create a permanent 301 redirect (which also tells the search engine to skip your default home page and index the new directory)

I personally prefer to use php redirect because it is much easier: (just one line code in your index page and that's it.
the code:
Quote:
<?php
Header( "HTTP/1.1 301 Moved Permanently" );
header( 'Location: http://www.yoursite.com/new_page.html' ) ;
?>
and add this to a file name index.php and that's it. That means rename your old index.php to something else if you want to keep that...

hopes that help

zoobie is offline   Reply With Quote
Old 11-07-2008, 10:50 PM   #5
roycecheng.com
 
Join Date: Nov 2008
Location: Singapore
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Social Networking View Member's FaceBook Profile  View Member's YouTube Profile
Default Re: how to remove index.php on the URL?

I'm sorry that I did not explain clearly in my first post.

If you willing to check on my blog, you will be able to see that for the URL of my every post, it is indicated as
roycecheng.com/index.php/YYYY/MM/blog-title/

How do I make the index.php disappear from the URL?

Your help is greatly appreciated. =)

killua is offline   Reply With Quote
Old 11-08-2008, 12:08 AM   #6
HyperActive Warrior
 
Join Date: May 2008
Location: USA
Posts: 249
Blog Entries: 22
Thanks: 9
Thanked 29 Times in 27 Posts
Default Re: how to remove index.php on the URL?

Hello killua,
Check your Wordpress settings. There two items you might need to adjust,

  1. WordPress address (URL)
  2. Blog address (URL)

awesometbn is offline   Reply With Quote
Old 11-08-2008, 12:32 AM   #7
roycecheng.com
 
Join Date: Nov 2008
Location: Singapore
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Social Networking View Member's FaceBook Profile  View Member's YouTube Profile
Default Re: how to remove index.php on the URL?

hmm.. they are both indicated as roycecheng.com only.

killua is offline   Reply With Quote
Old 11-08-2008, 12:39 AM   #8
roycecheng.com
 
Join Date: Nov 2008
Location: Singapore
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Social Networking View Member's FaceBook Profile  View Member's YouTube Profile
Default Re: how to remove index.php on the URL?

Thanks guys!

I had figured out already.

I have to insert:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

into my .htaccess file.

killua is offline   Reply With Quote
Old 11-08-2008, 08:48 AM   #9
HyperActive Warrior
 
Join Date: May 2008
Location: USA
Posts: 249
Blog Entries: 22
Thanks: 9
Thanked 29 Times in 27 Posts
Default Re: how to remove index.php on the URL?

Cool, I knew it must be something simple that was trying to re-write each URL. Great blog by the way. I'll be interested to see more from you. Thanks!

awesometbn is offline   Reply With Quote
Old 11-08-2008, 08:56 AM   #10
roycecheng.com
 
Join Date: Nov 2008
Location: Singapore
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Social Networking View Member's FaceBook Profile  View Member's YouTube Profile
Default Re: how to remove index.php on the URL?

haha. ya. its simple.. i overlooked it. wordpress actually teaches how to remove it. so sorry.

thanks! my blog is just reflecting on my life. i really want to learn more about internet marketing. very new to it. hope the people here will be able to help if i face any difficulties. =)

killua is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
index.php, indexphp, remove, url

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 05:35 PM.