Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Urgent ! .htaccess and RewriteEngine on problem !
Old 07-13-2011, 10:20 AM Urgent ! .htaccess and RewriteEngine on problem !
phazorRise's Avatar
Skilled Talker

Posts: 57
Name: Sachin Gutte
Trades: 0
i have my admin/index.php file showing links as -
HTML Code:
<a href="event.php?id=123"> View Birthday </a>
but i'm using .HTACCESS to make url something like-
HTML Code:
http://www.mysite.com/admin/event/123
and i've edited htaccess to -

Code:
RewriteEngine on
RewriteRule ^([^/\.]+)/?$ /event.php?id=(.*) [L]
but it still showing url as usual.

and i've apache with mod_rewrite.so loaded.

and one more thing, in other directory i've used htaccess as -
Code:
AddType application/x-httpd-php .html
to execute php code from html file. and it works just fine.

i'm using Apache on Windows.
any guess?

Last edited by phazorRise; 07-13-2011 at 10:22 AM..
phazorRise is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-13-2011, 10:25 AM Re: Urgent ! .htaccess and RewriteEngine on problem !
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
The rewrite rule won't alter the visible URL, it will only interpet the "friendly URL" to a URL that PHP can parse.

If you want the friendly URL, you just have to write it that way in your anchor links.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-13-2011, 10:32 AM Re: Urgent ! .htaccess and RewriteEngine on problem !
phazorRise's Avatar
Skilled Talker

Posts: 57
Name: Sachin Gutte
Trades: 0
Quote:
Originally Posted by mgraphic View Post
The rewrite rule won't alter the visible URL, it will only interpet the "friendly URL" to a URL that PHP can parse.

If you want the friendly URL, you just have to write it that way in your anchor links.
can you show me any example please.
phazorRise is offline
Reply With Quote
View Public Profile
 
Old 07-13-2011, 12:36 PM Re: Urgent ! .htaccess and RewriteEngine on problem !
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Quote:
Originally Posted by phazorRise View Post
can you show me any example please.
Instead of typing:
<a href="event.php?id=123"> View Birthday </a>

Use:
<a href="event/123"> View Birthday </a>
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-14-2011, 07:29 AM Re: Urgent ! .htaccess and RewriteEngine on problem !
phazorRise's Avatar
Skilled Talker

Posts: 57
Name: Sachin Gutte
Trades: 0
i tried it but is show -
Quote:
localhost/admin/event/123
in address bar and shows 404 page not found error.

my htaccess is like -
PHP Code:
RewriteEngine on
RewriteRule 
^id/([^/\.]+)/?$ event.php?id=$[L
phazorRise is offline
Reply With Quote
View Public Profile
 
Old 07-14-2011, 08:14 AM Re: Urgent ! .htaccess and RewriteEngine on problem !
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Ithink you want this:

Code:
RewriteEngine on 
RewriteRule ^admin/event/(\d+)/?$ event.php?id=$1 [L]
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-15-2011, 10:14 AM Re: Urgent ! .htaccess and RewriteEngine on problem !
phazorRise's Avatar
Skilled Talker

Posts: 57
Name: Sachin Gutte
Trades: 0
yeah.. thanks i tried the way you mentioned it. and it worked.
phazorRise is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Urgent ! .htaccess and RewriteEngine on problem !
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.64442 seconds with 12 queries