Jump to content

Recommended Posts

Good day everyone,

 

I'm building my new website and i'm using the next folder structure:

 

folder_Structure.png

 

 

 

www is the main directory with my index.php. Every page i open includes a php file from any subdirectory from a folder shown above (the folder structure is a small example of my folder structure).

 

To open a page i use a url like the next examples:

www.website.com/?pages=pages/contact/view.php
www.website.com/?pages=pages/admin/customers/add.php?user=1&p_id=1838&c=3
www.website.com/?pages=pages/products/list.php?cat=1&subcat=3&sort=price&direction=asc&limit=100

 

 

I do have a lot of different url structures but i would like to make a seo friendly url. Something like this:

 

https://www.website.com/contact/view

https://www.website.com/admin/customers/add/1/1838/3

https://www.website.com/products/list/1/3/price/asc/100

 

I have tried to use the mod rewrite generator (http://www.generateit.net/mod-rewrite/index.php) but my pages won't load (i receive 404 error pages).

 

 

I do have 1 mod rewrite working but that one is hard coded.

RewriteEngine On
RewriteRule ^([0-9]+)$ /index.php?pages=pages/products/view.php&id=$1 [L]

this one makes from website.com/3525 > website.com/index.php?pages=pages/products/view.php&id=3525

 

 

 

Thanks in advance!

Can anyone help me?

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/302382-mod-rewrite-with-folder-structure/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.