Jump to content

remove file name and extention


The Little Guy

Recommended Posts

Hi The Little Guy

 

To remove the file name and its extention, you have to write php script or use mod_rewrite module.

 

I want to show you mod_rewrite,apache module.To use this module you have a apache server,and there is a .htaccess file your host. You modify this file to change URLs.You can write and examine that rules ,

 

RewriteEngine On

RewriteBase /

RewriteRule ^school/images/(.*)$  images/$1

RewriteRule ^school/(.*).html      index.php?id=$1

 

After this rule you can use www.xxx.com/school/1.html so you hide your .php extension if you want remove extensions complately,use that

RewriteEngine On

RewriteBase /

RewriteRule ^(.*)      index.php?id=$1

 

then you can use www.xx.com/1 for example.

 

take care,bye :)

 

 

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.