Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.