Jump to content


Photo

How do I mod rewrite to another folder? [RESOLVED]


  • Please log in to reply
4 replies to this topic

#1 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 22 October 2006 - 06:36 PM

I have my main folder with index.php file in there which I have managed to mod rewrite successfully.

I have another folder within the main folder called admin.  In the admin folder I have another index.php file.

When I enter www.mydomain.com/admin/ it doesn't display index.php in the admin folder.

Here is my mod rewrite .htaccess

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^([A-Za-z0-9\-_]+)/?$ index.php?page=$1
RewriteRule ^gallery/([A-Za-z0-9\-_]+)/([0-9]+)/?$ index.php?page=$1&id=$2
RewriteRule ^([A-Za-z0-9]+)/([0-9\-_]+)/?$ index.php?page=$1&pagenum=$2
RewriteRule ^admin/([A-Za-z0-9\-_]+)/?$ admin/index.php?page=$1 [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 23 October 2006 - 04:42 PM

Make sure you have index.php added to the DirectoryIndex directive in the httpd.conf file.

#3 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 21 November 2006 - 11:07 PM

My website is hosted...Is it possible to check the httpd.conf file?
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 22 November 2006 - 07:05 PM

Check with your host, I dought they will though especially if you are on a shared host.

But you can add the following line to your .htaccess file:
DirectoryIndex index.php

If you want index.php to be your directory index.

#5 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 24 November 2006 - 07:18 PM

Done it...had to chenge the regular expressions
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