mod_rewrite for ugly URLs

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Daisy Cutter
Forum Commoner
Posts: 75
Joined: Sun Aug 01, 2004 9:51 am

mod_rewrite for ugly URLs

Post by Daisy Cutter »

Can anyone help me or give me a good site to find out about mod_rewrite.

Currently my URLs are very ugly (http://example.com/index.php?url=http:/ ... nclude.php)

I want to use mod_rewrite to make them like http://example.com/include.php or something.

Any answers?
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

you could create a frame set of 1px (top or bottom) and load in the other frame all your stuff.. your adresse will never change
ex : if it's http://www.l33t.com
if you go in csection contact the adress will still be : http://www.l33t.com
Daisy Cutter
Forum Commoner
Posts: 75
Joined: Sun Aug 01, 2004 9:51 am

Post by Daisy Cutter »

Draco_03 wrote:you could create a frame set of 1px (top or bottom) and load in the other frame all your stuff.. your adresse will never change
ex : if it's http://www.l33t.com
if you go in csection contact the adress will still be : http://www.l33t.com
I dont think thats a good practice because it breaks the URLs, I just want to simplify them.

With a frame, if you hit reload it will bring you back to the main page, and all links will load within the page, preventing bookmarking.

one of the reasons I registered a domain was to get away from the .tk frame stuff.
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

i agree... 8)
frames suxorz (see how l33t i am)
Daisy Cutter
Forum Commoner
Posts: 75
Joined: Sun Aug 01, 2004 9:51 am

Post by Daisy Cutter »

I need to get my URLs like this because google won't index my page with them the way they are, which is a tremendous drawback.

Anyone know a good tutorial, or can simply provide me with a way of turning

http://example.com/index.php?url=http:/ ... m/page.php into http://example.com/page.php (or even http://example.com/index.php/url/page.php is fine, I just need it to be search-engine friendly).
Daisy Cutter
Forum Commoner
Posts: 75
Joined: Sun Aug 01, 2004 9:51 am

Post by Daisy Cutter »

anyone know any tutorials? not being indexed in google really sucks.
Daisy Cutter
Forum Commoner
Posts: 75
Joined: Sun Aug 01, 2004 9:51 am

Post by Daisy Cutter »

I did it:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^goto-(.*)$ /index.php?url=http://kafene.org/$1

Now my URLs are like http://kafene.org/goto-filename.php

But it's very tricky, one wrong link and I could get a loop, or images will stop working (they'll try to access goto-filename.php/img/image.png)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

set a rule for your images

Code: Select all

RewriteRule images/(.*?)$ /images/$1
Post Reply