<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>WebDeveloper.com - Server Management</title>
		<link>http://www.webdeveloper.com/forum/</link>
		<description>Apache, Windows, .htaccess, and more</description>
		<language>en</language>
		<lastBuildDate>Sat, 25 May 2013 13:38:33 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.webdeveloper.com/forum/images/misc/rss.png</url>
			<title>WebDeveloper.com - Server Management</title>
			<link>http://www.webdeveloper.com/forum/</link>
		</image>
		<item>
			<title>.htaccess removing URL extensions</title>
			<link>http://www.webdeveloper.com/forum/showthread.php?278457-.htaccess-removing-URL-extensions&amp;goto=newpost</link>
			<pubDate>Thu, 23 May 2013 15:45:52 GMT</pubDate>
			<description><![CDATA[Basically what I am trying to do is remove the file extensions from my page URLs. 
 
I'm hosting through 1and1, using Web Files (which like a directory structure I can drop files into and create folders). Windows Platform. 
 
I have created an .htaccess file and put it in my root directory. 
 
The...]]></description>
			<content:encoded><![CDATA[<div>Basically what I am trying to do is remove the file extensions from my page URLs.<br />
<br />
I'm hosting through 1and1, using Web Files (which like a directory structure I can drop files into and create folders). Windows Platform.<br />
<br />
I have created an .htaccess file and put it in my root directory.<br />
<br />
The entire contents of my file are below:<br />
<br />
Options -MultiViews<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteCond %{REQUEST_FILENAME}\.php -f<br />
RewriteRule ^([^/]+)/$ $1.php<br />
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php<br />
<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$<br />
RewriteRule (.*)$ /$1/ [R=301,L]<br />
<br />
Order deny,allow<br />
ErrorDocument 404 /404.php<br />
DirectoryIndex default.php<br />
<br />
The first group of code is supposed to remove the .php extension from my URLs. i.e. <a rel="nofollow" href="http://www.lpbdevelopment.co.uk/currentprojects" target="_blank">www.lpbdevelopment.co.uk/currentprojects</a><br />
<br />
The second group of code is supposed to add a trailing slash to my URLs. i.e. <a rel="nofollow" href="http://www.lpbdevelopment.co.uk/currentprojects/" target="_blank">www.lpbdevelopment.co.uk/currentprojects/</a><br />
<br />
The third allows me to use a custom 404 page (which is called 404.php and is in my root directory) as well as making default.php my index page. For some reason if I have default.html it gets picked up as the index page automatically whereas default.php doesnt (after removing default.html). <br />
<br />
My files are there (for example currentprojects.php is in the root) and work if you add the .php on the end i.e. <a rel="nofollow" href="http://www.lpbdevelopment.co.uk/currentprojects.php" target="_blank">www.lpbdevelopment.co.uk/currentprojects.php</a><br />
<br />
Without the .php on the end I get a 404 error if the file doesn't have a directory by the same name (minus the .php) or a 403 access denied if it does.<br />
<br />
I have tried about 10 different versions of the above code. I know my file is being read as the 404 page works.<br />
<br />
If you can help me resolve this it would be awesome!</div>

 ]]></content:encoded>
			<category domain="http://www.webdeveloper.com/forum/forumdisplay.php?44-Server-Management">Server Management</category>
			<dc:creator>LiamPB</dc:creator>
			<guid isPermaLink="true">http://www.webdeveloper.com/forum/showthread.php?278457-.htaccess-removing-URL-extensions</guid>
		</item>
		<item>
			<title>Proper redirection to addon domain sub-directories</title>
			<link>http://www.webdeveloper.com/forum/showthread.php?278061-Proper-redirection-to-addon-domain-sub-directories&amp;goto=newpost</link>
			<pubDate>Thu, 16 May 2013 03:11:50 GMT</pubDate>
			<description><![CDATA[Although I hadn't changed anything in my .htaccess files for a while, I recently noticed in my Google Webmaster section that I was getting many errors in redirects. In checking my email error messages, I am getting hit with some weird URL requests. Mainly I'm getting errors that attempt to post to...]]></description>
			<content:encoded><![CDATA[<div>Although I hadn't changed anything in my .htaccess files for a while, I recently noticed in my Google Webmaster section that I was getting many errors in redirects. In checking my email error messages, I am getting hit with some weird URL requests. Mainly I'm getting errors that attempt to post to different subdirectories of an addon domain by bypass the directory of the addon domain and using the main domain. I'll try to explain it a bit simpler.<br />
<br />
I have the domain <i>example.org</i> and the addon <i>domain example2.org</i>. On <i>example2.org</i> I have a subdirectory <i>/sample</i> with a file <i>infoText.php</i>, so the proper link to it would be <i><a rel="nofollow" href="http://example2.org/sample/newText.php" target="_blank">http://example2.org/sample/newText.php</a> </i>. But I am getting errors which attempt to link to <i><a rel="nofollow" href="http://www.example.org/sample/newText.php" target="_blank">http://www.example.org/sample/newText.php</a> </i>. I have given up trying to figure out <i>why</i> this is happening and am trying to figure a work around using my .htaccess file. I had tried the following in the <i>example.org</i> .htaccess file:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Redirect /sample http://example2.org/sample</code><hr />
</div> but receive the following error message (it happens in Chromium also):<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">The page isn't redirecting properly<br />
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.<br />
This problem can sometimes be caused by disabling or refusing to accept cookies.</code><hr />
</div> In this case it has nothing to do with cookies. And the corrected URL <i>is</i> displayed in the address bar: <i><a rel="nofollow" href="http://example2.org/sample/netText.php" target="_blank">http://example2.org/sample/netText.php</a> </i>. I have also tried adding a trailing &quot;/&quot; to the <i>/sample</i> dir in the .htaccess file but get the same error message.<br />
<br />
I am really getting tired of all these errors. Any one have any ideas of how to do these redirects to solve this problem? (It shouldn't make a difference but if the entire .htaccess files for both domains are needed, just let me know. I'm just trying to save some space. As I said, I hadn't changed anything before this started happening. The rewrite rule for the addon domain is below)<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"># Stop access to subdomain from main domain<br />
RewriteCond %{HTTP_HOST} example\.org$<br />
RewriteRule ^(.*)$ &quot;http\:\/\/example2\.org\/&quot; [R=301,L]</code><hr />
</div> </div>

 ]]></content:encoded>
			<category domain="http://www.webdeveloper.com/forum/forumdisplay.php?44-Server-Management">Server Management</category>
			<dc:creator>LeeU</dc:creator>
			<guid isPermaLink="true">http://www.webdeveloper.com/forum/showthread.php?278061-Proper-redirection-to-addon-domain-sub-directories</guid>
		</item>
	</channel>
</rss>
