I have an app that allows users to create and build a site. Let's call it sistema.com. When a user creates a site with a domain (say domain.com) they have forwarded to our nameservers, it creates folders and adds their domain to our server through the cPanel API to a folder like system.com/[user id]/[site id]/. In that folder there's an index.php file and a .htaccess file that reads:
Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)/$ index.php?page=$1 [L]
I won't go into too much detail about how it works from there, but basically the user can create pages like domain.com/something/something-else/. The "something" folders obviously don't really exist and our system just picks them up from the htaccess and goes from there.
Mi problema es que domain.com/something/something-else/ funciona pero domain.com/something/something-else returns a 404. I've been doing research and trying many things but can't seem to get it working. Any ideas? Thanks in advance.
I should have mentioned what I've tried so far. I've tried changing the rewriterule to work regardless of the trailing slash, like so:
RewriteRule ^(.*)(?/$) index.php?page=$1 [L]
And other variations of that.
I've also tried different methods of forcing a trailing slash but none of those worked either.
preguntado el 03 de mayo de 12 a las 07:05
I think you want your rule to look like this:
RewriteRule ^(.*)/?$ index.php?page=$1 [L]
Which says : "Any number of any characters optionally followed by a slash should be changed to index.php?page=$1 where $1 is the characters you found before the slash. Also disregard any other rules that you find if this one matches."
its based on your url rewrite access rule..
RewriteRule ^(.*)/$ index.php?page=$1 [L]
como puedes ver index.php?page=$1 is aliased into / and all the requests is sent to index.php