Forum Moderators: phranque

Message Too Old, No Replies

mod rewite using .htacces

         

bheewhay

2:47 am on Dec 3, 2007 (gmt 0)

10+ Year Member



hi guys,
i have this problem, and i want change the url of my page using ,htaccess. i want the filename of the file that has been clicked to be its url.
i have this in my .htaccess file and it is not working.

RewriteEngine On
Rewritecond %{REQUEST_FILENAME}!-d
RewriteRule ^([-,_0-9a-zA-Z]+)/?$ view.php?keyword=$1 [L]

(http://www.mysite.com/folder1/folder2/view.php?keyword=19d05628bd8bf27af3ad) the url i want to change..
change it to:
[mysite.com...]

ITS NOT WORKING FOR ME... any suggestion! am i wrong?
THANK YOU VERY MUCH...

jdMorgan

3:24 am on Dec 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This isn't clear.
Is this newly-added code?
If you want the URL and the filename to be the same, then delete the code entirely, since URL=filename is the default behaviour of the server. Then use that URL in all links on your pages.

I suspect there's more to your question though. Perhaps a read through some of the threads in our Apache forum section of the WebmasterWorld library [webmasterworld.com] might prove useful.

Jim

bheewhay

7:20 am on Dec 3, 2007 (gmt 0)

10+ Year Member



hi jim,

Thanks for the thread link but it does not help me in
Rewritecond %{REQUEST_FILENAME}

sorry also if my problem is not clear...hehehe
at the same time, im a newbie in .htaccess coding...i've just very little knowledge on it... sorry...

about my problem,
http://www.mysite.com/folder1/folder2/view.php?keyword=19d05628bd8bf27af3ad --->this refers to a page for viewing one file in our database. and i want to rename it to http://www.mysite.com/folder1/folder2/filename-of-the-file-in-this-format-also as its url.
one my friend recommend me to use .htaccess and use
Rewritecond %{REQUEST_FILENAME} and i dont know this yet...THANKS!

jdMorgan

2:47 pm on Dec 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, then perhaps this thread [webmasterworld.com] will help you get started.

For more basic information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim