Jump to content

.htaccess Question


Link

Recommended Posts

Try this .htaccess file

Options +FollowSymLinks

<IfModule mod_php4.c>
  php_value session.use_trans_sid 0
  php_value register_globals 1
  php_value display_errors 1
</IfModule>

RewriteEngine On
RewriteBase /httpdocs/                  // here given your uri path after given remove this comment from htaccess file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)/$ www.domain.com/dir/page.php?ec==$1

Link to comment
Share on other sites

Shen, if I remove those lines, I get a page does not exist error.

 

DeadEvil, neither worked.

 

RewriteEngine on
RewriteRule ^(.*)  /home/eventron/public_html/events/index.php?ec=$1

 

The above brings up the index.php, but the files that are included in index.php aren't displaying properly probably because of directories and such.  Is there a way to forward to that address above rather than just displaying it through www.eventron.com/$1 ?

Link to comment
Share on other sites

And, this made things a bit better:

 

RewriteEngine on
RewriteRule [.*]eventron.com/(.*)^[.html|.php|.inc.php]  /home/eventron/public_html/events/index.php?ec=$1

 

which doesn't mess up other files, but it still gives me a page does not exist at www.eventron.com/abc123

Link to comment
Share on other sites

Sorry DeadEvil, but stick with me for just a second:

 

RewriteEngine on
RewriteRule ^([A-Za-z0-9]{6})  /home/eventron/public_html/events/index.php?ec=$1

 

That sets $ec = events....any clue why?  I want to check for a six character string that's not a file at www.eventron.com/STRING and then set that string to $ec in /events/index.php.  It can use redirect or whatever it needs to...

Link to comment
Share on other sites

GOT IT (actually)

 

RewriteEngine on
RewriteRule ^([A-Za-z0-9]{6})$  /home/eventron/public_html/events/index.php?ec=$1

 

Not sure why...wanna take a stab at explaining?  I understand Reg Ex, but I'm not sure why that worked here!

Link to comment
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.