Jump to content


Photo

How to access folder with mod rewrite


  • Please log in to reply
6 replies to this topic

#1 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 26 August 2006 - 05:00 PM

I have a folder named admin and when i type in www.mydomain.com/admin it tries to find a page called admin which obvioulsy doesn't exist

How do i mod rewrite a rule so it finds the folder admin?

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^([A-Za-z0-9]+)/?$ index.php?page=$1 [L]
RewriteRule ^([A-Za-z0-9]+)/([0-9]+)/?$ index.php?page=$1&pagenum=$2 [L]

If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 August 2006 - 05:08 PM

If its a folder you should have a forward slash after admin so its like this:
mysite.com/admin/

if you want to use admin to go to the admin folder then use this:
RewriteRule ^admin$ admin/


#3 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 26 August 2006 - 06:42 PM

How would I get it to direct to index.php in the admin folder
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 August 2006 - 09:10 PM

It should load up index.php automatically. If your server has had index.php added to the DirectoryIndex directive.

If it wasnt configured you might be able to add this to the htaccess file:
DirectoryIndex index.php


#5 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 27 August 2006 - 11:34 PM

Which htaccess file do i put that in...the one with the mod rewrite or the htaccess within my admin folder

Also how do I mod rewrite for a page such as change-password.php  ???
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still

#6 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 28 August 2006 - 09:23 AM

You put it in the htaccess file that is in the root of your websites folder you upload your files to.

#7 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 28 August 2006 - 04:11 PM

I put it in both htaccess files but it doesn't work.

When i type in www.mysite.com/admin/ it asks for my username and password from the htaccess file so i know it works but it's not opening index.php.  It will if i add index.php at the end but no on its own
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users