| | |
Need help in .htaccess
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Apr 2009
Posts: 34
Reputation:
Solved Threads: 0
Hi Guys!
I have a url like www.mysite.com/index.php?req=login
I want it like that www.mysite.com/login
I want to hide php extension from that. Please reply.
Thank you
Take care.
I have a url like www.mysite.com/index.php?req=login
I want it like that www.mysite.com/login
I want to hide php extension from that. Please reply.
Thank you
Take care.
Try this:
PHP Syntax (Toggle Plain Text)
RewriteEngine On RewriteRule ^([^.]+[^/])$ index.php?req=$1
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
•
•
Join Date: Apr 2009
Posts: 34
Reputation:
Solved Threads: 0
Hi Cwarn,
Thank you for your reply.
The problem is that I have this code already in my .htaccess file
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?req=preview&login_name=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?req=preview&login_name=$1L]
this code turns this url
mysite.com/index.php?req=preview&login_name= 'somename'
into
mysite.com/somename
So, this code does not let the code work that you told me like.
RewriteEngine On
RewriteRule ^([^.]+[^/])$ index.php?req=$1
which turns this url www.mysite.com/index.php?req=login
into
mysite.com/login
So, what will be the solution.
Your help in this matter will be highly appreciated. Thank you.
Take care.
Thank you for your reply.
The problem is that I have this code already in my .htaccess file
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?req=preview&login_name=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?req=preview&login_name=$1L]
this code turns this url
mysite.com/index.php?req=preview&login_name= 'somename'
into
mysite.com/somename
So, this code does not let the code work that you told me like.
RewriteEngine On
RewriteRule ^([^.]+[^/])$ index.php?req=$1
which turns this url www.mysite.com/index.php?req=login
into
mysite.com/login
So, what will be the solution.
Your help in this matter will be highly appreciated. Thank you.
Take care.
the try this:
or
If this is not your solution , then tel me clearly...
PHP Syntax (Toggle Plain Text)
RewriteRule ^login$ login.php?req=preview&login_name=$1
or
PHP Syntax (Toggle Plain Text)
RewriteRule ^([^.]+[^/])$ login.php?req=$1
Last edited by Shanti Chepuru; May 4th, 2009 at 6:10 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
•
•
•
•
Hi Cwarn,
Thank you for your reply.
The problem is that I have this code already in my .htaccess file
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?req=preview&login_name=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?req=preview&login_name=$1L]
this code turns this url
mysite.com/index.php?req=preview&login_name= 'somename'
into
mysite.com/somename
So, this code does not let the code work that you told me like.
login as the prefix you would need something like .login Below is an example for .login as the ending prefix. PHP Syntax (Toggle Plain Text)
RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?req=preview&login_name=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?req=preview&login_name=$1 RewriteRule ^\.login$ index.php?req=login
Last edited by cwarn23; May 4th, 2009 at 6:20 am.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Then did you place the
.htaccess file in the same directory/folder as the index.php page? Also, did you remember to place the dot before the word login within the login. So the url should be something like http://www.example.com/.login Also check that the real file responds when using the real address. Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
![]() |
Similar Threads
- Disable access to .htaccess (Linux Servers and Apache)
- .htaccess not working.! (Linux Servers and Apache)
- .htaccess mod_rewrite problem (Linux Servers and Apache)
Other Threads in the PHP Forum
- Previous Thread: make it so double-select menu remembers DB entries... when updating record
- Next Thread: Need .htaccess Help
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube






