Remove index.php from URL
#1
Hi,

this is a very simple way to remove the index.php from your URL. Please note that this only works if you are running an Apache web server and mod_rewrite is enabled!

Just add the following lines to your root .htaccess file (directly after RewriteEngine On):

RewriteCond %{IS_SUBREQ} false
RewriteRule ^index.php$ http://www.example.org [R=301,L]

Of course you have to replace www.example.org wit your own MyBB installation. For example:

RewriteRule ^index.php$ http://community.mybb.com [R=301,L]
(this will work on this domain)

RewriteRule ^index.php$ http://www.example.org/board/ [R=301,L]
(if you installed MyBB in a sub folder)

The trick is the IS_SUBREQ: So the redirect will not work in sub directories like /admin or /archive (the index.php have to stay there) and it will no affect POST or GET requests!
Reply


Messages In This Thread
Remove index.php from URL - by querschlaeger - 2010-08-28, 11:01 PM
RE: Remove index.php from URL - by techsniper - 2010-10-19, 06:35 PM
RE: Remove index.php from URL - by Hocker - 2010-10-23, 12:39 PM
RE: Remove index.php from URL - by ecanikajo - 2010-10-23, 09:44 PM
RE: Remove index.php from URL - by faviouz - 2010-10-23, 09:57 PM
RE: Remove index.php from URL - by andrewjs18 - 2011-01-07, 08:47 PM
RE: Remove index.php from URL - by frostschutz - 2011-01-07, 10:31 PM
RE: Remove index.php from URL - by andrewjs18 - 2011-01-07, 10:54 PM
RE: Remove index.php from URL - by frostschutz - 2011-01-07, 11:34 PM
RE: Remove index.php from URL - by andrewjs18 - 2011-01-07, 11:54 PM
RE: Remove index.php from URL - by frostschutz - 2011-01-08, 12:19 AM
RE: Remove index.php from URL - by andrewjs18 - 2011-01-08, 12:34 AM
RE: Remove index.php from URL - by bigoliver - 2011-03-16, 04:50 PM
RE: Remove index.php from URL - by labrocca - 2011-01-08, 02:16 AM
RE: Remove index.php from URL - by kaixer - 2011-01-09, 10:39 PM
RE: Remove index.php from URL - by Victor - 2011-01-13, 11:54 AM
RE: Remove index.php from URL - by terrymason - 2011-04-28, 02:20 PM
RE: Remove index.php from URL - by Johnrichardo21 - 2011-06-14, 05:16 AM
RE: Remove index.php from URL - by kavin - 2011-06-14, 05:48 PM
RE: Remove index.php from URL - by KaMiNa - 2014-08-07, 06:57 PM
RE: Remove index.php from URL - by munguiatom - 2015-09-07, 05:30 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)