Jump to content

Recommended Posts

Posted

Hi guys,

I've been trying to get this to work now for a while, so I thought that someone here may be able to help me.

I'm trying to make the URL rewrite work so that I can remove index.php from phpVMS.

I've already been trying myself so the URL Rewrite function in phpVMS is already set to true, I really would like to be able to remove the index.php so if anyone has done this before and can help me it would be much appreciated.

Regards

Jamie

  • Moderators
Posted

With out modding all the code i dont think you can, its been hardcoded in. Nabeel will be able to reply better to this.

Yeah I tried that and it gave me the errors.

Otherwise I would like to see that in php VMS.

  • Administrators
Posted

There is a rewrite option, you just need to setup the HTACCESS to work properly.

I don't have access to an Apache server with phpVMS on it - if someone wants to give me access to mess with it, I can take a look

  • Administrators
Posted

This ends up need a few changes with how URLs are handled, so it will be available on the next version for sure.

I'm testing to see if an updated version of just the CodonRewrite class will help, so you can have it for current releases, at leas, by just updating that file, and an htaccess

Everything uses the url() function in bootstrap.php, so the fix ends up being pretty simple, but that doesn't even need changing.

  • Moderators
Posted

This ends up need a few changes with how URLs are handled, so it will be avail on the next version for sure.

I'm testing to see if an updated version of just the CodonRewrite class will help, so you can have it for current releases, at least

Awsome to hear Nabeel.

So how is it done? Is it like that.......

http://yourva.com/index.php/profile

into

http://yourva.com/profile

Is that right if not, can you clear it up please. Thanks. :D

  • Administrators
Posted

Yeap, that would be it. Infact, you can test it real quick, see if it works...

Place into /core/classes:

https://github.com/nshahzad/phpVMS/raw/master/core/classes/CodonRewrite.class.php

Then in the root (next to index.php), place in a .htaccess file:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1  [L]

See if that works. I can't edit the CodonRewrite file due to a permissions error, and he hasn't gotten back to me yet.

  • Like 1
  • Moderators
Posted

Ok, I got the server internal error when I did it.

Nevermind, It works now.

But I'm not sure how to test it. What do you want me to run with?

  • Administrators
Posted

Can you try this full htaccess:


Options +FollowSymLinks
Options All -Indexes 

# Rewrite Rules
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1  [L]

<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>

Try getting to a .tpl file as well

THanks

  • Moderators
Posted

Oh, Mine's the same.

It's does work with no problems.

# main page of the site
DirectoryIndex index.php

# prevent viewing of a specific file
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>

# prevent viewing of index
Options -Indexes

#Can give without index.php for the modules
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1  [L]

  • Administrators
Posted

No worries i sorted it ;)

Nabeel, did you manage to get rid of that fs pax message about no aircraft entered?

Can you create a bug for that? Otherwise I wont remember.

Just a warning to all, there are still some issues with this rewrite thing, I have to sort them out soon

Posted

I'm not sure if this is an issue with the rewrite, but when using actionurl() it just acts as a url() - I went into the actionurl function in whichever file it hides in and removed the if statement, seems to work now.

  • 1 year later...
  • 3 weeks later...
Posted

Managed to do this but I have an issue where the acars map wont work with just /acars but only with /index.php/acars

Also the OFC library used for charts and stuff is only working with /index.php/

any help?

  • 1 month later...
Posted

I have the problem that if I switch rewrite on it shows the mainpage without problems but no modules Livemap when click on the links it sends me back to Home any ideas ?

  • 2 months later...
Posted

ok this gives me the modules too

except the Acars map data does not show up any idea help needed!

# main page of the site
DirectoryIndex index.php
# prevent viewing of a specific file
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>
# prevent viewing of index
Options +FollowSymLinks
Options All -Indexes

#Can give without index.php for the modules
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1  [L]

  • 2 months later...
  • 1 month later...
Posted

I'm having a similar problem... The .htaccess is configured and URL_REWRITE e set to true. I can atually print_r the q= coming from .htaccess, but wherever I click, it only shows the homepage.

I was having that too. I fixed it by using the CondonRewrite.class.php of David Clark's extended version on Nabeel's full version downloadable here in phpvms.net and this .htaccess. It works 100% for me now.

# main page of the site

DirectoryIndex index.php

# prevent viewing of a specific file

<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$">

Order Allow,Deny

Deny from all

</FilesMatch>

# prevent viewing of index

Options +FollowSymLinks

Options All -Indexes

#Can give without index.php for the modules

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?q=$1 [L]

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.

Loading...
×
×
  • Create New...