<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Get last word in url Archives - Cody Paste</title>
	<atom:link href="https://www.codypaste.com/tag/get-last-word-in-url/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codypaste.com/tag/get-last-word-in-url/</link>
	<description>THE WEB PLAYGROUND</description>
	<lastBuildDate>Fri, 01 Jul 2016 14:50:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.codypaste.com/wp-content/uploads/2022/12/cropped-codypaste-32x32.png</url>
	<title>Get last word in url Archives - Cody Paste</title>
	<link>https://www.codypaste.com/tag/get-last-word-in-url/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Website URL without file extension</title>
		<link>https://www.codypaste.com/website-url-without-file-extension/</link>
					<comments>https://www.codypaste.com/website-url-without-file-extension/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Mon, 27 Jun 2016 06:55:42 +0000</pubDate>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[.html Extensions with .htaccess File]]></category>
		<category><![CDATA[Get last word in url]]></category>
		<category><![CDATA[How to Remove .php]]></category>
		<category><![CDATA[last word of url]]></category>
		<category><![CDATA[website without file extension htaccess rewrite]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=457</guid>

					<description><![CDATA[<p>First, verify that the mod_rewrite module is installed. Then, be careful to understand how it works, many people get it backwards. Redirect All Requests To Index.php Using .htaccess  Get characters after last / in url Create Base URL and include PHP file with Base URL in Core PHP Just add .htaccess file to the root &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/website-url-without-file-extension/" class="more-link">read more<span class="screen-reader-text"> "Website URL without file extension"</span></a></p>
<p>The post <a href="https://www.codypaste.com/website-url-without-file-extension/">Website URL without file extension</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>First, verify that the mod_rewrite module is installed. Then, be careful to understand how it works, many people get it backwards.</p>
<ul>
<li><a href="http://www.codypaste.com/redirect-all-requested-url-to-index-php-using-htaccess/" target="_blank">Redirect All Requests To Index.php Using .htaccess </a></li>
<li><a href="http://www.codypaste.com/last-word-of-url-in-php/" target="_blank">Get characters after last / in url</a></li>
<li><a href="http://www.codypaste.com/base-url-and-include-with-base-url-in-php/" target="_blank">Create Base URL and include PHP file with Base URL in Core PHP</a></li>
</ul>
<p>Just add .htaccess file to the root folder of your site. </p>
<p>Now I&#8217;ll show you complete flow of website URL withour file extension .php, .html</p>
<p>&nbsp;</p>
<p><strong>.htaccess</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag"># Enable Rewriting
RewriteEngine on


 
# Rewrite user URLs
#   Input:  user/NAME/
#   Output: user.php?id=NAME

#RewriteRule ^about/(\w+)/?$ about.php?id=$1

#RewriteRule ^about/?$ about.php



#RewriteRule ^vipul-rai/?$ about.php?id=$1

#RewriteRule (.*) index.php [L]


RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

ErrorDocument 404 /404.php</pre><p></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>index.php</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;table width="100%" border="0" cellspacing="10" cellpadding="0"&gt;
  &lt;tr&gt;
    &lt;td width="50%"&gt;&lt;a href="home"&gt;Home&lt;/a&gt;&lt;/td&gt;
    &lt;td width="50%"&gt;&lt;a href="about-us"&gt;About Us&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;






&lt;?php include "page-controller.php"; ?&gt;</pre><p></p>
<p>&nbsp;</p>
<p><strong>page-controller.php</strong></p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;?php

$cURL=$_SERVER['REQUEST_URI'];
preg_match("/[^\/]+$/", "$cURL", $matches3);

if(isset($matches3[0]))
{
$lastURL = $matches3[0];
}
else
{
	$lastURL ="";
}

if($lastURL!="")
{
	switch ($lastURL)
	{
  	case "": include"pages/home.php";
  	break;
  
  	case "home": include"pages/home.php";
  	break;
	
	case "about-us": include"pages/about-us.php";
  	break;
	
  
 
	default:
  	echo"page not found";
	}

}
else
{
	include"module/pages/home.php";
}


 
?&gt;</pre><p></p>
<p>&nbsp;</p>
<p><strong>pages/about-us.php</strong></p>
<p>Create a folder &#8216;pages&#8217; and save a file &#8220;home.php / about-us.php&#8221;. this is your landing page, you can do what you want to do. 🙂</p>
<p>The post <a href="https://www.codypaste.com/website-url-without-file-extension/">Website URL without file extension</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/website-url-without-file-extension/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
