Search the Community
Showing results for tags 'RewriteEngine'.
-
I'm working on setting my webpage up with a single index.php file that injects HTML into itself from header.php, footer.php, content.php, etc. And I want to rewrite the URL depending on what content is loaded into the main container. So after header.php, it would load content.php, and the PHP script will be setup to search based on which menu item was clicked for a stub like "/content/stub/latest-news-1.html" and inject the file name into the <div name=" ">, and the HTML contents between the <div> tags. The injected HTML would be something like: <div id="main-container" style="main-style" name="latest-news"><p>Some info goes here</p></div> ... and another script to write the URL as "example.com/latest-news/1/". But whithout changing the .htaccess contents, the URL rewrite script in PHP will make the URL look like "example.com/index.php?/latest-news/1/" What I need to do is modify the .htaccess file to rewrite "index.php" as "/". The trouble is, HelioHost, like a lot of other host companies, hide the .htaccess file from the File Manager as well as from FTP. You can't upload .htaccess directly to the root folder without an error telling you the file already exists. But you can upload sample.htaccess to a sub-folder, rename it to .htaccess, then move it to the root folder - overwriting the previous file. But not having access to the original .htaccess file, I don't want to replace it with a version that removes needed instructions found in the original. Can someone please post the original .htaccess file contents, or at least the settings (if any) that may affect site functionality so I don't accidentally cripple my page?
- 2 replies
-
- RewriteEngine
- URL masking
-
(and 2 more)
Tagged with: