Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

Mod Re-Write Help

Status
Not open for further replies.
Yes mod_rewrite module is installed. Yes the server is Apache and .htaccess is in the correct dir.

Last time i used just mod_rewrite to change this. Someone one here gave me the code but i cant seem to find the post.

Would it help with the PHP i used to create the page?

Thanks, Darren.
 
Right just to clarify what mod_rewrite does, incase its not actually capable of doing whats required.

Mod_Rewrite is kinda like David Copperfield, it creates illusions that

dom.com/music

actually exists when in reality its a puff of smoke and a mirror that shows you

dom.com/html/files.php?pg=page&title=music

making it look pretty.

Thats all it does, it can't modify your code, so your links are also needing updates, it doesnt create files, folders or modify anything its just smoke and mirrors.

One of my clients I use

Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^ephedrine$ /ephedrine.php [NC,L]
RewriteRule ^order$ /order.php [NC,L]
RewriteRule ^links$ /links.php [NC,L]
RewriteRule ^contact$ /contact.php [NC,L]
RewriteRule ^$ /index.php [NC,L]

It works as it should.

I then had to modify my menu's to link to ./links rather than links.php to make it look pretty.
 
This is the PHP i have used to create the pages.

Code:
<li><a href="?pg=home">Home</a></li>
<li><a href="?pg=movies">Movies</a></li>

PHP:
<?php

function home()
{
include "inc/home.php";
}

$choice=$_GET['pg'];

switch($choice)
{
case "home": include "inc/home.php"; break;
case "biography": include "inc/biography.php"; break;
case "movies": include "inc/movies.php"; break;
case "television": include "inc/television.php"; break;
case "shop": include "inc/shop.php"; break;
case "forum": include "inc/forum.php"; break;
case "contact": include "inc/contact.php"; break;
default:
home();
}
?>
 
Status
Not open for further replies.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom