Jump to content

Url Forwarding


pgrevents

Recommended Posts

I dunno of this is the right place but here is what I am trying to do

 

current urls are working like this;

http://www.pgrevents.co.uk/profile.php?show=pgrated

 

what I want is;

http://www.pgrevents.co.uk/pgrated

 

But I was wondering if the above could show me the same results as it would with the show=pgrated

 

for example;

www.bebo.com/pgrated

takes me to that profile

 

 

i dot know if any of what i said makes sense to anyone.

 

 

thanks

 

Paul

Link to comment
https://forums.phpfreaks.com/topic/157441-url-forwarding/
Share on other sites

Yes it does make sense ;)

 

You can use a htaccess with mod_rewrite to rewrite your url like that :

 

The user will see this :

http://www.pgrevents.co.uk/pgrated

While this will be called internaly :

http://www.pgrevents.co.uk/profile.php?show=pgrated

 

You need the mod_rewrite module enable and put that in your .htaccess :

Options +FollowSymLinks

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /profile.php?show=$1 [NC,L]
</IfModule>

 

Everything that not a file (to prevent other file like css, image, ...) will be rewritten to profile.php?show=

 

 

Link to comment
https://forums.phpfreaks.com/topic/157441-url-forwarding/#findComment-830175
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.