Jump to content

Recommended Posts

Posted (edited)

I didn't know how to quite describe my question in the topic, but I believe it has to with scripting, so I hope this is in the right section.

 

Looking around the Net, I notice some sites have URLs to pages like this:

 

www.somesite.com/folder/page

 

How do they do this without an extension? I'd like to do the same thing or somethign similar. For instance my review of "The Closer":

 

www.moviemansguide.com/reviews/DVD/read.php?id=closer-season3

 

Is there a way to make it:

www.moviemansguide.com/reviews/DVD/closer-season3 or closer-season3.html?

Edited by TheMovieman
Posted

They are most likely using some sort of CMS package where the post title becomes the URL. Blogs do this using a method called Permalinks. It's basicly a translation done in the .htaccess file.

Posted
www.somesite.com/folder/page

 

How do they do this without an extension? I'd like to do the same thing or somethign similar. For instance my review of "The Closer":

 

I'm not sure about the /page part, but if you have a folder and the url is

www.somesite.com/folder/

and you have an index.htm (or index.html) inside that folder, then

www.somesite.com/folder/

will take you to the index page without you having to type /index.htm

Posted

Try this in your htaccess file

 

>RewriteEngine On 

RewriteCond %{SCRIPT_FILENAME} !-f 
RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteRule ^([^/]+)/?$ /read.php?id=$1 [QSA,L]

Posted

Well, I gave it a try and it didn't work. I have a few htaccess files (one on the main and another in the "reviews" folder. Tried for both and it didn't work. Thanks for helping, though.

Posted

If its a 404 then it means that the page you have pointed it to doesn't exist...

 

So i guess its something to do with:

 

RewriteRule ^([^/]+)/?$ /read.php?id=$1 [QSA,L]

 

 

Im no good at mod_rewrite so I dont know

 

 

 

If it was a 500 error it would have been a .htaccess error.. so I imagine its that line I have pasted above. Its possibly looking in the wrong directory? Not sure

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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