Jim Gordon
Jim Gordon

Reputation: 1

rewrite _index.php to home.html

I'm looking at some old code for a company website, basically familiarizing myself with different coding practices. One thing I noticed is that the main website page is _index2.php and redirects to a page called home.html

I'm curious about this. I've been reading about RewriteRule in .htaccess but the underscore in front of the index2.php file is throwing me off. the home.html file seems to be generated by the website's CMS and imports the php file into it. This is something I haven't really seen before.

To messs around a bit I'd like to create a _index3.php and have it imported into home2.html for testing/experiments/learning. I generated a home2.html page using the site CMS and now I'd like someone to guide me in how to import the _index3.php file using RewriteRule (If that's how it's done)

Sorry for the long winded question, I'm learning and I thought a thorough explanation is the way to go.

Upvotes: 0

Views: 198

Answers (1)

anubhava
anubhava

Reputation: 785196

put this code in your DOCUMENT_ROOT/.htaccess file:

RewriteEngine On
RewriteRule ^_index\.php$ /home.html [L,NC]

Upvotes: 1

Related Questions