Jump to content

neat url


sandrob57

Recommended Posts

Mod Rewrite; Basically in your root directory...

make a file called .htacess.

 

 

.htaccess

# Rewrite Mod

RewriteEngine on
RewriteBase /
RewriteRule ^user/(.*)$ myfancyurl.com/user/profile.php?lookup=$1 [L]

 

ok here it is:

RewriteEngine on ; turn the engine on

RewriteBase / ; set the root directory.

RewriteRule ^user/(.*)$ myfancyurl.com/user/profile.php?lookup=$1

^ = start

(.*) = userid as a variable

$ = end of match.

then $1 = value of (.*).

And i forgot. [L] = last action

 

So you now make your links. /user/192643

Link to comment
Share on other sites

xyn love the given example.

 

I am studying mod_rewrite can you kindly tell me if you use a regular exspristion in mod_rewrite

the regulalr exsprision is the same as what eregi or preg dont get it cheers.

 

If you could write your example but with the correct regular exspression please.

 

 

Sorry to but in cheers.

Link to comment
Share on other sites

# Rewrite Mod

RewriteEngine on
RewriteBase /
RewriteRule ^[a-z]{0,10}\/\(\.\*\)\.(html)\$[a-z}{1,10}\.
[a-z]{0,3}\/[a-z]{1,4}\/[a-z]{0,10}\.[a-z{0,3}\?[a-z]{0,10}\=\$1 [L]

 

now if i am write now you can have the url

 

 

/user/192643.html

 

now you can get in the seach engine as friendly.

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.