News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

removing the index.php from my home link

Started by jumpenjuhosaphat, April 16, 2007, 03:34:22 PM

Previous topic - Next topic

jumpenjuhosaphat

In the links bar, I have it pointing to www.mysite.com/, but in the breadcrumbs links, it is still pointing at www.mysite.com/index.php.  I need to remove the index.php part, what file do I need to look in to find that link at?

Oldiesmann

Sources/Querystring.php

Find
Code (Lines 87-88) Select
// Makes it easier to refer to things this way.
$scripturl = $boardurl . '/index.php';


Replace
// Makes it easier to refer to things this way.
$scripturl = $boardurl . '/';

jumpenjuhosaphat


glennk

This doesnt work for me. Can anyone think of any reason why please ?

Col

#4
I Glennk,

You did replace the code and not add to it - right? That's the only reason I can think of.

Anyway, as the code stands, it would be best to not use it. I've just discovered that this code was the cause of quite a serious problem for my forum. I wish I had discovered this before I went for a complete reinstall of the forum and modifications! :-X

http://www.simplemachines.org/community/index.php?topic=179131.0

Can anyone think of a solution to the forum not rendering properly upon the first visit using the above code?

Thanks.

glennk

Hi Col,

I replaced it as suggested but no change for me here. I cant for the life of me figure out why it wont work. I need to find a way to redirect but at the moment it just isnt happening.

glennk

Hi Col

Try this :

#Forward index.php to /
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.whitbyseaanglers.co.uk/forum/$1 [R=301,L]

Obviously change the domain to your own and stick this in the forum .htaccess

It works for me. Let me know what you think

glennk

Ok slight problem with that.

It works in the redirect sense, but you cant log in to admin

Can anyone make any suggestion ?

H

This was marked as solved. As multiple people have tried this as not all have been successfull could someone else please confirm that this works?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Col

It is not solved! I had to remove the code. It causes a serious but practically invisible problem. Upon the first load of the forum, the CSS is not rendered in any browser. Unless they refresh their browser or delve into the very uninviting forum, they will just just view a completely unstyled forum. A different solution is needed.

H

What is the CSS path when the hack is used?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Col

I use extensionless URLs, but added some code the .htaccess file to make sure that the CSS files were correctly interpreted by the browsers:

AddType text/css .css

This didn't make any difference, and besides, there is no problem with any of my pages outside of the forum.

Kindred

what are first 10 lines of your style.css?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Col

/* who's in chat */
.chat-block
{
   border: 1px solid #696969;
   padding: 2px;
   background-color: #eeeedd;
}

.windowbg3 .smalltext a:link, .windowbg3 .smalltext a:visited {
text-decoration: underline;
}

/* Normal, standard links. */
a:link
{
   color: #476C8E; /* #245EDC; */
   text-decoration: none;
}


The .chat-block class came after this problem was reported.

I could do with cleaning out some commented-out code that I made whilst editing on the fly. Anyway, what is it you are looking for?

Kindred

ok...   in that case, how is the CSS file called in index.template.php?

The errors I got fro your site when I last tested it suggest that the CSS is not being loaded because it is being sent as text/html, not text/css.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Col

Hi Kindred,

These are the calls to the CSS files. They are unchanged since I was having this problem.

   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?fin11" />
   <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />
   <link rel="stylesheet" type="text/css" href="/css/menu" />';


The second call is to my site menu CSS file, and does not carry the .css file extension. I have server mapping on all files outside of the forum, and assumed that would be the correct call for that outside stylesheet. In anycase, the only CSS that was passed on the first view with this small mod installed, was the CSS for my own menu bar! The forum stylesheet was the one missing.

I guess I could re-enable this code (if we coordinated a time) so that you could see the effect. You would need to clear your cache to observe the effect though.

jerm

Your site does seem to be working fine now. Is this resolved then?

Col

Hi,

No, it's not resolved. I put up with the unneeded index.php extension. :(

I assume Kindred missed my last reply. ???

metallica48423

ideally i think it'd be best to redirect yoursite from the index.php less version to the version with it -- consistency in the URL's is better for SEO than having inconsistencies where the crawler skips around all over the place.

And if you're worried about doing this FOR SEO -- For a single dynamic page -- it really will not harm you.

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Advertisement: