Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

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.
 
seanbean/./co /./uk/movies is working ?

I just went to that and its fine ?
 
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();
}
?>
 
change the

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

to

<li><a href="./">Home</a></li>
<li><a href="./movies">Movies</a></li>


That should work ok.
 
Thats it, Thanks Skinner. Much appreciated to all those that helped. +Rep left.
 
Status
Not open for further replies.

The Rule #1

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

Premium Members

New Threads

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom