<rss version="2.0">
		<channel>
			<title>Plogger Support Forum - .htaccess and Cruft-Free URLs doubles slashes</title>
			<lastBuildDate>Sat, 07 Nov 2026 11:03:46 +0000</lastBuildDate>
			<link>http://www.plogger.org/forum/</link>
			<description></description>
			<generator>Lussumo Vanilla 1.1.10</generator>
			<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11615#Comment_11615</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11615#Comment_11615</guid>
		<pubDate>Tue, 03 Nov 2009 07:35:41 +0000</pubDate>
		<author>Michael Tully</author>
		<description>
			<![CDATA[Can please some one take a look at my site and if at all explain why when I turn on Generate Cruft-Free URLs, i seem to get doubles slash before the actual url i.e www.whatever.com//the rest of the url in mod_rewrite.<br /><br />looked in the Database for trailing slashed under the Path section, not a thing<br /><br />heres the the .htaccess<br /><br /><br /><code ># BEGIN Plogger<br />&lt;IfModule mod_rewrite.c&gt;<br />RewriteEngine on<br />RewriteBase /<br />RewriteCond %{REQUEST_URI} !(\.|/$)<br />RewriteRule ^.*$ http://www.planet-templates.com%{REQUEST_URI}/ [R=301,L]<br />RewriteCond %{HTTP_HOST} !^www [NC]<br />RewriteRule ^(.*)$ http://www.planet-templates.com/$1 [R=301,L]<br />RewriteCond %{REQUEST_FILENAME} -d [OR]<br />RewriteCond %{REQUEST_FILENAME} -f<br />RewriteRule ^.*$ - [S=2]<br />RewriteRule feed/$ plog-rss.php?path=%{REQUEST_URI} [L]<br />RewriteRule ^.*$ index.php?path=%{REQUEST_URI} [L]<br />&lt;/IfModule&gt;<br /># END Plogger</code><br /><br />here the URL<br /><br /><a href="http://www.planet-templates.com" >http://www.planet-templates.com</a><br /><br />Cheers<br />Michael]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11714#Comment_11714</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11714#Comment_11714</guid>
		<pubDate>Wed, 11 Nov 2009 19:27:10 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[I have the same problem. Doubles slashes = // , after the host.]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11715#Comment_11715</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11715#Comment_11715</guid>
		<pubDate>Wed, 11 Nov 2009 19:47:12 +0000</pubDate>
		<author>sidtheduck</author>
		<description>
			<![CDATA[Try this. Open plog-load-config.php and look for the following code starting on line 94:<br /><code >// if mod_rewrite is on and we're not embedded, remove the file basename<br />if ($config['use_mod_rewrite'] == 1 &amp;&amp; $config['embedded'] == 0) {<br />	$config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/';<br />// otherwise just use our cleaned up version of $_SERVER['PHP_SELF'] from plog-globals.php<br />} else {<br />	$config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];<br />}</code><br />and replace it with this:<br /><code >// if mod_rewrite is on and we're not embedded, remove the file basename<br />if ($config['use_mod_rewrite'] == 1 &amp;&amp; $config['embedded'] == 0) {<br />	$config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);<br />	// Verify URL for a trailing slash.  If not, add one.<br />	if ($config['baseurl']{strlen($config['baseurl'])-1} != '/') {<br />		$config['baseurl'] = $config['baseurl'].'/';<br />	}<br />// otherwise just use our cleaned up version of $_SERVER['PHP_SELF'] from plog-globals.php<br />} else {<br />	$config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];<br />}</code>]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11717#Comment_11717</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11717#Comment_11717</guid>
		<pubDate>Wed, 11 Nov 2009 20:16:00 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[The code seems to be ok, but a second slash is stil beeing added.]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11718#Comment_11718</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11718#Comment_11718</guid>
		<pubDate>Wed, 11 Nov 2009 20:19:57 +0000</pubDate>
		<author>sidtheduck</author>
		<description>
			<![CDATA[What do you think is wrong with the 5th line?  I don't have any errors when I test the code.  Can you post an error message?]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11719#Comment_11719</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11719#Comment_11719</guid>
		<pubDate>Wed, 11 Nov 2009 20:20:58 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[Sorrym the error was a copy&amp;paste, but the //slash problem is stil there. Sorry.]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11720#Comment_11720</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11720#Comment_11720</guid>
		<pubDate>Wed, 11 Nov 2009 20:22:04 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[The site is actually working, but the URLS is like, for example<br />http://www.domain.com//plogger-test-collection/album-1/492744-original/]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11721#Comment_11721</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11721#Comment_11721</guid>
		<pubDate>Wed, 11 Nov 2009 20:24:10 +0000</pubDate>
		<author>sidtheduck</author>
		<description>
			<![CDATA[Did you copy / paste the entire thing?  Line 3 is different in the 2 code examples above.]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11723#Comment_11723</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11723#Comment_11723</guid>
		<pubDate>Wed, 11 Nov 2009 20:27:53 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[Yes.<br /><br />I found out that the actual $config['baseurl'] is http://www.domain.com<strong >\</strong> - not a slash, but a backslash in the end<br /><br />I changed the <br /><code ><br />if ($config['baseurl']{strlen($config['baseurl'])-1} != '/')<br /></code><br /><br />to <br /><code ><br />if ($config['baseurl']{strlen($config['baseurl'])-1} != '\\')<br /></code><br /><br />and not I got rid of the double slash.<br /><br />Do you think it is the best way to do it? Do you know where this backslash is added?]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11724#Comment_11724</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11724#Comment_11724</guid>
		<pubDate>Wed, 11 Nov 2009 20:36:33 +0000</pubDate>
		<author>sidtheduck</author>
		<description>
			<![CDATA[Are you on a windows host by chance?  I'm guessing that's where the backslash is added as windows uses backslash for directory separation and linux uses forward slash.<br /><br />Did your original URL look like this -> http://www.domain.com\/collection-name/album-name/picture.jpg ?]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11725#Comment_11725</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11725#Comment_11725</guid>
		<pubDate>Wed, 11 Nov 2009 20:37:51 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[Yes, I run Windows server.<br /><br />And No, that was the strangest thing. The URL looked like http://www.domain.com<strong >//</strong>collection-name/album-name/picture.jpg  before the changes.]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11726#Comment_11726</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11726#Comment_11726</guid>
		<pubDate>Wed, 11 Nov 2009 20:42:56 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[Ok, I just realized you are using dirname to get the base url ... that will create this problem with the backslash. Thanks for the help, I will have to really looked out for it when upgrade in the future.]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11727#Comment_11727</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11727#Comment_11727</guid>
		<pubDate>Wed, 11 Nov 2009 20:45:01 +0000</pubDate>
		<author>sidtheduck</author>
		<description>
			<![CDATA[weird.<br /><br />I'll do some more tests and see if there's an easy universal way to determine this for windows or linux.  We're only running into issues here because dirname($_SERVER['PHP_SELF']) returns '/' or '\' instead of just being blank.<br />Let me know if you come across anything else in your testing as well.<br /><br />p.s. what happens when you <code >echo $_SERVER['PHP_SELF']'</code>?  Is there a backslash there?]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11728#Comment_11728</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11728#Comment_11728</guid>
		<pubDate>Wed, 11 Nov 2009 20:50:39 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[<code >$_SERVER['PHP_SELF']</code><br /><br />gives just /index.php<br /><br />but <br /><br /><code >dirname($_SERVER['PHP_SELF'])</code><br /><br />always gives \  in windows.<br /><br />---<br /><br />Maybe just runing <br /><code >$config['baseurl'] = str_replace('\\', '/', $config['baseurl']); </code><br />after second line is all it is needed. That will at least solve WIndows issue.]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11729#Comment_11729</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11729#Comment_11729</guid>
		<pubDate>Wed, 11 Nov 2009 20:57:11 +0000</pubDate>
		<author>sidtheduck</author>
		<description>
			<![CDATA[that is odd, but correct per the PHP manual.<br /><br />Here is a slightly longer code that should work:<br /><code >$config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].str_replace('\\', '/', dirname($_SERVER['PHP_SELF']));</code><br />or maybe try this:<br /><code >$config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].realpath(dirname($_SERVER['PHP_SELF']));</code>]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11730#Comment_11730</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11730#Comment_11730</guid>
		<pubDate>Wed, 11 Nov 2009 20:57:17 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[This works for me.<br /><br /><code ><br />// if mod_rewrite is on and we're not embedded, remove the file basename<br />if ( $config['use_mod_rewrite'] == 1 &amp;&amp; $config['embedded'] == 0) {	<br />	$config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);<br />	$config['baseurl'] = str_replace('\\', '/', $config['baseurl']);<br />	// Verify URL for a trailing slash.  If not, add one.	<br />	if ($config['baseurl']{strlen($config['baseurl'])-1} != '/') {<br />		$config['baseurl'] = $config['baseurl'].'/';	<br />	}<br />	// otherwise just use our cleaned up version of $_SERVER['PHP_SELF'] from plog-globals.php<br />} <br />else {	<br />	$config['baseurl'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];<br />}</code>]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11731#Comment_11731</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11731#Comment_11731</guid>
		<pubDate>Wed, 11 Nov 2009 20:58:08 +0000</pubDate>
		<author>sidtheduck</author>
		<description>
			<![CDATA[heh, same thing as I have :D<br /><br />Can you check the realpath() example?]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11732#Comment_11732</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11732#Comment_11732</guid>
		<pubDate>Wed, 11 Nov 2009 21:00:37 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[realpath is not the way to go. The str_replace you and me suggestion at the same time is the best solution at this point.<br /><br />Thanks! Will make a theme for this one, so maybe I will find more things in time!]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11733#Comment_11733</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=11733#Comment_11733</guid>
		<pubDate>Wed, 11 Nov 2009 21:02:49 +0000</pubDate>
		<author>bloggus</author>
		<description>
			<![CDATA[Just FYI<br /><br /><code >realpath(dirname($_SERVER['PHP_SELF']))</code> gives just <code >C:\</code>]]>
		</description>
	</item>
	<item>
		<title>.htaccess and Cruft-Free URLs doubles slashes</title>
		<link>http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=13808#Comment_13808</link>
		<guid isPermaLink="false">http://www.plogger.org/forum/comments.php?DiscussionID=2925&amp;Focus=13808#Comment_13808</guid>
		<pubDate>Wed, 08 Jun 2011 03:43:21 +0000</pubDate>
		<author>ashkir</author>
		<description>
			<![CDATA[Thanks bloggus! That fixed my problem!]]>
		</description>
	</item>
	
		</channel>
	</rss>