Welcome Guest, Not a member yet? Register   Sign In
URL Rewriting - Resolved-
#1

[eluser]Unknown[/eluser]
Hello,

I've a problem with my url rewriting.
My configuration: Mac - PHP 5.6 - Mamp 1.7.2
I'm working on the localhost

To be sure that rewrite active, i've used phpinfo:

Loaded Modules:

core prefork http_core mod_so mod_access mod_auth mod_auth_anon mod_auth_dbm mod_auth_digest mod_file_cache mod_echo mod_charset_lite mod_cache mod_disk_cache mod_mem_cache mod_example mod_case_filter mod_case_filter_in mod_ext_filter mod_include mod_deflate mod_log_config mod_env mod_mime_magic mod_cern_meta mod_expires mod_headers mod_usertrack mod_setenvif mod_proxy proxy_connect proxy_ftp proxy_http mod_bucketeer mod_mime mod_dav mod_status mod_autoindex mod_asis mod_info mod_cgi mod_cgid mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_imap mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_php5

My '.htaccess' file:

SetEnv PHP_VER 5
Options -Indexes
Options -MultiView
Options +FollowSymlink
RewriteEngine On

#Interdiction d'accèder au dossier système et création d'un controller system.php
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php/$1 [L]


#Réécriture si ni fichier ni dossier
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

application/config/config.php:

$config['base_url'] = 'http://localhost:8888/trainingSite/';

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/

$config['index_page'] = '';


I've 2 pages with a link; when i've clicked on the link (to go the subscribe page) i got this error message:
"The requested URL /codeigniter/site/subscribe was not found on this server"

Please could you help ???!!!

Thanks
#2

[eluser]Unknown[/eluser]
I've found the solution...

The problem was that I didn't put the .htaccess file on the path :red:

I've modified my .htaccess also:

RewriteEngine On RewriteBase

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php/$1 [L]

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

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB