Jump to content

change links using .htaccess


KhaledBawz

Recommended Posts

Hey @KhaledBawz,

 

not too much time today but when I ran your script I've got a fake result:

Array
(
    [username] => jazzman.php
)

But, userName is just jazzman, not jazzman.php, right?

 

Secondly, what about if you have inheritance in your files, so one URL goes to second then goes to third and so on?

 

Anyway, I am glad to see that you sorted out this issue.

 

Have a nice day,

 

jazz.

Link to comment
Share on other sites

about the fake result I just fixed now, I didn't notice it last time

RewriteEngine On
 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^/?([a-z]+)$ $1.php [L]

Options +FollowSymLinks
RewriteRule profile-(.*)$ profile.php?username=$1					
								

all links is working fine, no any duplicated in path :) thank you jaz I appreciate your help

Link to comment
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.